0

My question is simple:

How can I reset or restart a world in Box2dWeb?

I need to do this when the player reloads the level he is playing.

Sony packman
  • 810
  • 2
  • 10
  • 21

1 Answers1

0

The easier way is to remove world, then create it again.

Another way is to store all initial parameters of a world and every body, and set it while restart is needed. Do not forget to remove bodies you created during play (a bullets for example), and create bodies, you removed (killed enemies, collected bonuses, etc.)

gridsane
  • 519
  • 4
  • 13
  • Are there any very simple examples out there that will show a html page with a simple canvas and Box2dWEB. – Doug Hauf Jun 25 '14 at 14:14