Welcome to the Treehouse Community
Looking to learn something new?
frame jump in finished game
I have been playing this game on my iPhone and it still does frame jump? how can l resolve this?
The best way to fix the problem is to do what is called object pooling.
The reason for the frame jump is you are creating pieces of the ship, ships, and bullets and creating a lot at once. Creating new objects or allocating memory is an expensive task for the CPU. So you see the frame skip a bit.
Object pooling is where you create lets say 30 bullets ahead of time and track which ones are being used and which aren't Use the ones that are not being used and instead of deleting them when they are off screen you would put them back into the pool and use it later.
Easiest way to do it is precreate them on load and put them in an array. Then track which was the last one you took and take the next one.
If you do this for bullets and cats and pieces you will have no frame jump at all.
Which iPhone are you using? (4, 4s, 5, 5s) Are you loading the version from the store, or from the source? Where in the game does it start to frame jump? Can you relate any part of the game to when the frame jump happens, such as when you shoot?