micky_25
01-17-2010, 09:41 AM
Hey guys, basically trying to implement a game retry/restart button when the player dies and am having problems.
I have three arrays holding terrain objects, enemies and friendlies, which are all added to a "map" object.
Anyway, I tried looping through all three arrays and removing the objects from the terrain and splicing the arrays then re-generating the map with enemies,etc. This worked, but everytime a restarted the game got slower and slower. I also tried just removing all items from the stage, then re-adding them, but this also resulted in the game getting slower and slower.
Hopefully I am making some sense, any ideas on whats up, or a better way of going about this?
here is a old version of the game without the restart/retry button, but will probably give an idea of what i have to remove/regenerate
http://240887.com/game
I have three arrays holding terrain objects, enemies and friendlies, which are all added to a "map" object.
Anyway, I tried looping through all three arrays and removing the objects from the terrain and splicing the arrays then re-generating the map with enemies,etc. This worked, but everytime a restarted the game got slower and slower. I also tried just removing all items from the stage, then re-adding them, but this also resulted in the game getting slower and slower.
Hopefully I am making some sense, any ideas on whats up, or a better way of going about this?
here is a old version of the game without the restart/retry button, but will probably give an idea of what i have to remove/regenerate
http://240887.com/game