Hi,
(i’ve not posted this in the GE forum because it can apply to just display objects too)
What would be the most efficient way to pool sprites so that items off screen are not accessed by the renderer etc?
eg say i have a pool of 100 reusable display objects which I can get from the pool 1 at a time… then when 3 connect in my game I remove them from the play area and add them back to the reusable pool. I can then use this display object again without instantiating (which should save on memory/gc/speed etc?), but I may want to change the object’s graphic (if it’s a sprite) and change the physics body assigned (if it’s in the Game Edition)
but aside from the GE stuff, when it’s not in use it should be inactive as possible but without removing the object (eg not rendered etc even though it’s offscreen)
do i just set it’s visibility to false? is there anything else I can do. eg store it in an array but remove it from the display lsit etc?
hope i’ve explained this clearly enough, obviously some examples would’ve helped!
thanks for any advice
regards
J
[import]uid: 6645 topic_id: 3452 reply_id: 303452[/import]