add start of ship controls

This commit is contained in:
Asraelite 2016-03-22 00:42:48 +00:00
parent 1027d980c1
commit fcfe1e8790
10 changed files with 131 additions and 2 deletions

View file

@ -20,7 +20,7 @@ class Physics {
bodyDef.position = new b2Vec2(body.x || 0, body.y || 0);
bodyDef.fixedRotation = false;
bodyDef.active = true;
bodyDef.linearVelocity = new b2Vec2(body.xvel || 0.05, body.yvel || 0);
bodyDef.linearVelocity = new b2Vec2(body.xvel || 0, body.yvel || 0);
bodyDef.angularVelocity = body.rvel || 0;
bodyDef.type = body.type == 'static' ?
Box2D.b2Body.b2_staticBody : Box2D.b2Body.b2_dynamicBody;