freke1981SWE Posted September 13, 2014 Share Posted September 13, 2014 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 More sharing options...
freke1981SWE Posted September 15, 2014 Author Share Posted September 15, 2014 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 More sharing options...
eguneys Posted September 15, 2014 Share Posted September 15, 2014 Share your code. Link to comment Share on other sites More sharing options...
Glaydur Posted September 15, 2014 Share Posted September 15, 2014 How are you even suppose to play this on mobile with keyboard controls? Link to comment Share on other sites More sharing options...
freke1981SWE Posted September 16, 2014 Author Share Posted September 16, 2014 The code can be found on here: http://campaign.nelly.com/js/app.js?20140915. On mobile touch controls (phaser buttons) are used instead of cursor keys. Link to comment Share on other sites More sharing options...
Recommended Posts