mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixes #78 revisited weight handycap
This commit is contained in:
parent
b6d67a0581
commit
e404ad3598
7 changed files with 27 additions and 16 deletions
|
|
@ -278,7 +278,10 @@ function (Parent, Box2D, Settings, CollisionDetector, Item, Nc) {
|
|||
if (this.isStanding()) {
|
||||
|
||||
this.body.SetAwake(true);
|
||||
var vector = new Box2D.Common.Math.b2Vec2(0, -Settings.JUMP_SPEED);
|
||||
|
||||
var jumpSpeed = Settings.JUMP_SPEED;
|
||||
|
||||
var vector = new Box2D.Common.Math.b2Vec2(0, -jumpSpeed);
|
||||
this.body.SetLinearVelocity(vector);
|
||||
|
||||
this.setStanding(false);
|
||||
|
|
|
|||
|
|
@ -72,10 +72,7 @@ function (Parent, Box2D, Options, Settings, Exception, Nc) {
|
|||
var fixtureDef = new Box2D.Dynamics.b2FixtureDef();
|
||||
fixtureDef.shape = itemShape;
|
||||
|
||||
var offset = 4,
|
||||
factor = 80;
|
||||
var density = ((this.options.weight + offset) / this.options.width / this.options.height) * factor;
|
||||
fixtureDef.density = density;
|
||||
fixtureDef.density = this.options.weight;
|
||||
fixtureDef.friction = Settings.ITEM_FRICTION;
|
||||
|
||||
fixtureDef.restitution = this.options.bounce
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue