How i stop and start my game?

Hmm … Sorry my bad english >< but …

I have a problem … I don’t know how i make for stopping my game after of collision …

And, how i make be after of stop, appearance one button saying “Start ?”, and after they person click that the button, the game initialize again ?

Really sorry my bad english :C

Hello,

According to my understanding, I think you want to stop your game on collision and want to display a start button on game over and on clicking start game should restart.

So what I have done in my code is,

  1. Pause physics on collision.

  2. Handle all timers and transition, if any.

  3. Handle all listeners, if any.

  4. Show and overlay for showing “Game Over” by storyboard.showOverlay( sceneName, options ). For example you have a class name gameOverOverlay for showing game over you can write, storyboard.showOverlay( “gameOverOverlay”, options ).

  5. Then code in gameOverOverlay class for displaying a button named start.

  6. On start button event use storyboard.gotoScene(sceneName, effect, time) and to remove contents from screen use removeAll().

Try this.

Hello,

According to my understanding, I think you want to stop your game on collision and want to display a start button on game over and on clicking start game should restart.

So what I have done in my code is,

  1. Pause physics on collision.

  2. Handle all timers and transition, if any.

  3. Handle all listeners, if any.

  4. Show and overlay for showing “Game Over” by storyboard.showOverlay( sceneName, options ). For example you have a class name gameOverOverlay for showing game over you can write, storyboard.showOverlay( “gameOverOverlay”, options ).

  5. Then code in gameOverOverlay class for displaying a button named start.

  6. On start button event use storyboard.gotoScene(sceneName, effect, time) and to remove contents from screen use removeAll().

Try this.