Game Development Community

t2dstaticsprite memory/performance question

by Johnny Vo · in Torque Game Builder · 06/30/2009 (10:42 am) · 3 replies

In my game that I'm currently working on, I always have about 10-15 sprite on screen and constantly killing them off and making new ones. Now my question, is it better to have 10-15 objects and reuse them or is it okay the way I'm doing it (deleting and creating new sprites). I'm creating this game in TGB right now but it's intended to be on the iPhone later. Will the method I'm using right now be a problem (like memory or performance problems) on the iPhone.

Thanks!

#1
06/30/2009 (2:26 pm)
everytime you create a new imagemap, theres a performance hit on the scene, with very few imagemaps, you shouldnt notice it, but when you create, say, 100 imagemaps on a single loop, you start to notice that it takes a hit.

so, the way you're doing it is ok, if you keep the ammount of immages created and deleted low, but if you think that eventually that number will increase greatly, then you should think on maybe making those images invisible for awhile, and then reuse them (reseting its previous values and stuff)...

just an idea.
#2
06/30/2009 (2:49 pm)
thanks ehrlichmann
#3
06/30/2009 (4:21 pm)
not a problem.