Optimization of AndEngine game

前端 未结 6 1964
南旧
南旧 2021-02-01 09:06

I am using java + AndEngine in my game.

During the game i have some freezes, i looked for the information and found some steps how to optimize game performance:

6条回答
  •  悲&欢浪女
    2021-02-01 09:47

    The approach I'm using is to load all needed textures before the level starts. When you go to the next level, you should unload only the textures of the objects that are not needed in the next level. Others, like scoreboard or main background should not be loaded. And of course you need to unload all your textures in your activity's onStop. It's true, that firstly you should optimize the looping code, for example, you should not access any resources during a loop, try to fetch them all before you start a loop.

提交回复
热议问题