Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
Phaser3 Codecademy Levels: creating levels with different platform layouts

how do I create a platform generating game based on the entries of the 'heights' property of the game scene classes that are extended from Scene?

I found this on codecademy but did not understand...enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I understand now.

First set this.heights property in the level instances based on the Level class. Since the background image 3(the length of the game) is 2000 and the height is 600, we split the length into 9 sections of 220px and its height into 8 sections of 70px.

enter image description here

Therefore there are 9 numbers in the heights list, each with a value from 0 to 8.

For example: [0, null, 3, 8, 2, 4, 6, 7, 2]. If null, nothing is generated.

Then create platform generating functions based on the heights entries in the original Level class.

enter image description here

enter image description here

Now we can set different heights entries for different level instances and all these levels will have different layout. this way we don't have to place each platform for each level specifically. enter image description here

In the game: enter image description here

The one Codey is standing on might be 5, and the one to the left might be 7.

Please forgive me for any mistakes(I'm a true beginner).

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda