Easiest way to reset the playground and game without freshing the entire browser?
  • I want a simple way for my user to get back into the game after the gameOver variable is true. What is required if gameOver is true inorder to make this happen? clearAll and then something else...?

    Thanks for any advice!
  • use clearScenegraph, recreate your sprites and reset the values of your variables. That should do it.
  • how do we return or execute clearScenegraph, and does is come with a callback function?
  • selimselim
    Accepted Answer
    clearScenegraph is a synchron methode so you don't have a callback, just execute whatever you want after it and it will be ok.

    you simply call $.playground().clearScenegraph() and all the elements from you game will be erased. You must just make sure that no other existing methodes will try to access them after that point.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!