Jump to content

How to reset the stage? Starting and resetting a game


TechSlave
 Share

Recommended Posts

I'm doing a game for university and i don't know how to make it start and restart, like when you open the game page and when you lose, to restart, how should i do that?

Basically, the game should start when i press some button, keep going for a time and when the time reachs zero the player lose, his score is showed and he can press a button to restart.

I'm noob on javascript, learning just for this game. I already got help here and i'm learning things slow, but couldn't manage to do that, any help?

 

Link to comment
Share on other sites

Functions :-)

You can either reload the entire scene,

E.g using a createScene function like in the PG, on restart; dispose, re-run createScene.

Or you can use the same scene and make a restart function which resets everything to default values, disables stuff that shouldn't be visible at start, etc :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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