Jump to content

Restart game state properly


freke1981SWE
 Share

Recommended Posts

Hello!

 

I´ve just a made a simple snake style game. Where I create sprites, sounds, starts arcade physics and inputs in the create of my game state. When the snake dies I do a restart on the state and reinit some variabels. This works fine on desktop (60 fps) but on mobile I got around 30 fps at first but after a restart call it drops to like 10 fps and after one more it drops again. What can be wrong?

 

I´ve tried to do a clean up of the audio, sprites and inputs (buttons with touch handler) in a shutdown of the game state and move the arcade physics start to a preload state (so it just start once). But the performace on mobile (tested on iPhone 4) is still bad after a restart of the state. Any idés how to properly restart a game state with arcade physics or how I can track that whats causing the issue.

 

You can preview a version of the game here, this version don´t have the clean up in the shutdown nor the fps in the renderer, but maybe it can show any memory leaks or double bodies in the physics?!

 

http://campaign.nelly.com/

Link to comment
Share on other sites

Anyone who has any idéas? I´ve tried to clean up all sprites and so on. Even removed the physics, added an extra game restart state just to be sure everything is cleaned up. But all things I´ve tested results in a "smoot" first game play, but as soon as I restart it the fps drops a lot.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...