i'm making a bouncy ball game, with ball objects of type "ball".
at the start of the code, the program gets the number of balls to display from an array. the higher the level number, the more balls.
the balls are drawn all at the same time on every tick during the level. however, as expected, the game starts to slow down at about level 6 (55 or so balls). at the end of each level, i use a for...each loop to delete all of the balls before reinitialising the next lot.
the problem is that when you get "game over" and start again on level 1 with 15 balls, the game runs as slow as level 6 did with 55 balls. The code which deletes all the balls is called at the end of each level, whether you win or lose, so they must be gone.
is it possible that when you delete the instances, the space is still reserved in RAM? if so, how do i overwrite the old locations?
neil
at the start of the code, the program gets the number of balls to display from an array. the higher the level number, the more balls.
the balls are drawn all at the same time on every tick during the level. however, as expected, the game starts to slow down at about level 6 (55 or so balls). at the end of each level, i use a for...each loop to delete all of the balls before reinitialising the next lot.
the problem is that when you get "game over" and start again on level 1 with 15 balls, the game runs as slow as level 6 did with 55 balls. The code which deletes all the balls is called at the end of each level, whether you win or lose, so they must be gone.
is it possible that when you delete the instances, the space is still reserved in RAM? if so, how do i overwrite the old locations?
neil