0

I am trying to make a small physics game to understand box2dweb better. I want the game to be able to detect when a certain shape, is in contact with a certain sensor or body. Which I can then use to determine if the player has won or not. There appears to be no real documentation for box2dweb, how the documentation for box2dflash should be similar enough to use, as far as I've read. It does however contain nothing on the subject. (That I understand at least).

I've tried this for loop to detect the current position of the shape solBDef. However, I only get it's starting position written in the console, no matter how much I move it around. (the loop is bound up on a function with a 1 sec timer, so it constantly runs).

for (var i = 0; i < 2; i++) {             
    console.log(solBDef.position);
}

I have a sensor body(goalBDef/goalDef) with which I would like the shape(solBDef/solDef) to interact. So that I can make an if-statement in my game-loop, which detects and determines whether the player has won.

SteveC
  • 15,808
  • 23
  • 102
  • 173

0 Answers0