mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fooled around with joints for hiding lag
This commit is contained in:
parent
f5eacb6335
commit
8f245f33d6
4 changed files with 68 additions and 12 deletions
|
|
@ -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 () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue