kripken / box2d.js

Port of Box2D to JavaScript using Emscripten
1.33k stars 196 forks source link

Node server side implementation #115

Closed cristw closed 2 years ago

cristw commented 3 years ago

How should I use Box2D to create rooms in real time and update each room step?

Im kinda new in this and the only guide I see are those demos that just create a bunch of objects and let them fall.

What I need is object movement(by user input), collision detection that knows what collided with what. Im having a hard time because Im not that experienced.

I also tried to do this:

var b2d;

Box2D().then(function(Box2D) { b2d = Box2D; });

And use b2d, it didnt work(lol). So everything has to be done inside the function? What if I need to create rooms(worlds) real time when players connect?