I’ve been going through this SpaceInvader tutorial, and it seems to be very badly designed.
For one thing, there is this SpriteCache class, that extends on ResourceCache (in case you have AudioCache manager also).
The thing is that each time I call spriteCache.getSprite(“imagename.png”); it returns me a new object! This is a big overhead since I only need one instance of the image to exist.
So if I have the same 6 sprites on the screen, then the file is only loaded 1 time, but 6 instances of the image exist.
I want this to be so that if there were no matter how many sprites on the screen, then the sprite should only be loaded once, and only one instance exist … just painted at different locations.
Any good SpriteCache (manager) out there that I can use? Or any ideas how to solve this?