mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixed throwing and meter
This commit is contained in:
parent
86dcdf92df
commit
3a07d946b0
4 changed files with 84 additions and 45 deletions
|
|
@ -269,7 +269,15 @@ function (Parent, Box2D, Settings, CollisionDetector, Item) {
|
|||
|
||||
var body = item.body;
|
||||
body.SetAwake(true);
|
||||
body.ApplyImpulse(new Box2D.Common.Math.b2Vec2(x * 3, -y * 3), body.GetPosition());
|
||||
|
||||
body.ApplyImpulse(
|
||||
new Box2D.Common.Math.b2Vec2(
|
||||
x * Settings.MAX_THROW_FORCE,
|
||||
-y * Settings.MAX_THROW_FORCE * 2 // 2 is to throw higher then far
|
||||
),
|
||||
body.GetLocalCenter()
|
||||
);
|
||||
body.SetAngularVelocity(5);
|
||||
};
|
||||
|
||||
Doll.prototype.onFootSensorDetection = function(isColliding, fixture) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue