ironkayman/tftm-alien-invasion

Performance: use TextureAtlas for OnslaughtWave's aliens' SpriteList

Opened this issue · 0 comments

Currently, we use externally defined dict of identified with loaded in-memmory textures, then we pass a reference to this dict to every spawned alien, - that approach fixed several performace issues, but still causes regular performance drops up to 6 FPS.

A new approach is based around that every SpriteList has an internal TextureAtlas whose textires are atored in Us memmory bank, and is nuild to contain multiple textures per sprite, latter is our's case since every alien has fixed number of states and every spawner can spawn only a sungle type of alien, this means constantly fixed number of textures for a variable, through spawn-despawn cycle, numbe of same aliens.