Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

171
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda