mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixed problems with first world update
This commit is contained in:
parent
283a1ef48b
commit
93e8133c89
13 changed files with 353 additions and 166 deletions
|
|
@ -36,25 +36,6 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Notificat
|
|||
document.body.appendChild(this.stats.domElement);
|
||||
};
|
||||
|
||||
GameController.prototype.makeMouseJoint = function(p) {
|
||||
var ground = this.physicsEngine.getGround();
|
||||
var body = this.me.getBody();
|
||||
|
||||
var def = new Box2D.Dynamics.Joints.b2MouseJointDef();
|
||||
|
||||
def.bodyA = ground;
|
||||
def.bodyB = body;
|
||||
def.target = p;
|
||||
|
||||
def.collideConnected = false;
|
||||
def.maxForce = 100;
|
||||
def.dampingRatio = 0.99;
|
||||
|
||||
this.mouse_joint = this.physicsEngine.world.CreateJoint(def);
|
||||
|
||||
body.SetAwake(true);
|
||||
}
|
||||
|
||||
GameController.prototype.destruct = function() {
|
||||
//destroy box2d world etc.
|
||||
};
|
||||
|
|
@ -128,5 +109,13 @@ function (Parent, Box2D, PhysicsEngine, ViewManager, PlayerController, Notificat
|
|||
Parent.prototype.loadLevel.call(this, path);
|
||||
}
|
||||
|
||||
GameController.prototype.userLeft = function(user) {
|
||||
var doll = this.players[user.id].doll;
|
||||
var i = this.gameObjects.animated.indexOf(doll);
|
||||
if(i>=0) this.gameObjects.animated.splice(i, 1);
|
||||
|
||||
Parent.prototype.userLeft.call(this, user);
|
||||
}
|
||||
|
||||
return GameController;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue