I've optimized it further just because It's fun to do. I've now made all the sprites in spriteanim shared and managed by texturemanager. Only using 10mb of memory.chili wrote:Yeah, you will find that stuff at the entity level like that costs a lot less than you might originally thing. This is why I constantly scold people for premature optimization at that level. It often just isn't worth it, and it's better to write clean, scalable, idiomatic code at that that level, and save the optimized hacks for just the few portions where it really matters.
Also, I will be adding NPC logic to the code (random walk patterns ), so that will reduce the performance by a lot if there are tons of entities on screen.
I get where you are coming from, though. Micro-optimizing isn't always the best, and I really should be polishing last in most cases.