Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

88
Vistas
Is storing Phaser Containers computationally/space efficient? (2D game framework question)

This question is about Phaser.js, javascript game framework for creating games, though I think the question can probably be generalised to any framework like Pygame.

Say I want to represent different in-game locations with Phaser Containers, where each container contains many images. The containers appear slightly different (contain different images) every time they are rendered. A new container needs to be rendered every 1-2 mins or so when user navigates around the game.

Is it more computationally efficient if all my possible containers are stored in a container array, and they're toggled visible and invisible when needed? Or can they cheaply be recreated and re-rendered as and when you need them? However, if it's computationally efficient, will saving containers consume lots of memory?

Any help is appreciated, thanks!

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

One of the fastest ways is to store all images possible onto one single sprite sheet. That sheet gets loaded once during the initial loading of the game, and any and all displayed things are shown by copying pixels from the sprite sheet onto a single html canvas.

If a Phaser Container is a canvas, then having too many would slow down the game.

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos