fooled around with joints for hiding lag

This commit is contained in:
Logsol 2013-07-30 21:15:11 +02:00
parent f5eacb6335
commit 8f245f33d6
4 changed files with 68 additions and 12 deletions

View file

@ -11,12 +11,17 @@ function (Settings, Box2D, CollisionDetector) {
new Box2D.Common.Math.b2Vec2(0, Settings.BOX2D_GRAVITY),
Settings.BOX2D_ALLOW_SLEEP
);
this.ground = null;
}
Engine.prototype.getWorld = function () {
return this.world;
}
Engine.prototype.getGround = function () {
return this.ground;
}
Engine.prototype.setCollisionDetector = function (player) {
var detector = new CollisionDetector(player);
@ -24,7 +29,9 @@ function (Settings, Box2D, CollisionDetector) {
}
Engine.prototype.createBody = function (bodyDef) {
return this.world.CreateBody(bodyDef);
var body = this.world.CreateBody(bodyDef);
if(!this.ground) this.ground = body;
return body;
}
Engine.prototype.update = function () {