Jump to content

Restart state completely


AbdSab
 Share

Recommended Posts

Hi all 

 

I have a big problem:

 

At the game over scene which is in the same of the game state, i have two button replay and main menu

 

When i click replay which have the function:

 

 

this.game.state.restart(false,true);

 

The state restart but when i click at the place where the button was, the state restate again.

 

I think that the button is not destroyed just the sprite which is destroyed, i have tried button.kill() and button.destroy() before restating state but i get an error.

 

And when i do : 

 

 

this.game.state.restart();

 

I get an error of an undefined velocity ......., 

 

The question is, is there any way to restart the state like if it's the first time the state is started ??

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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