mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
added image preloader and doll sensor
This commit is contained in:
parent
3aa89fc8d6
commit
1dcc21d0b5
20 changed files with 651 additions and 23 deletions
|
|
@ -74,6 +74,18 @@ function (Parent, Box2D, Settings, CollisionDetector) {
|
|||
}
|
||||
|
||||
this.body.CreateFixture(fixtureDef);
|
||||
|
||||
var grabSensorLeftShape = new Box2D.Collision.Shapes.b2PolygonShape();
|
||||
grabSensorLeftShape.SetAsOrientedBox(10 / Settings.RATIO, 20 / Settings.RATIO, new Box2D.Common.Math.b2Vec2(-10 / Settings.RATIO, -10 / Settings.RATIO));
|
||||
fixtureDef.shape = grabSensorLeftShape;
|
||||
fixtureDef.isSensor = true;
|
||||
this.body.CreateFixture(fixtureDef);
|
||||
|
||||
var grabSensorRightShape = new Box2D.Collision.Shapes.b2PolygonShape();
|
||||
grabSensorRightShape.SetAsOrientedBox(10 / Settings.RATIO, 20 / Settings.RATIO, new Box2D.Common.Math.b2Vec2(10 / Settings.RATIO, -10 / Settings.RATIO));
|
||||
fixtureDef.shape = grabSensorRightShape;
|
||||
fixtureDef.isSensor = true;
|
||||
this.body.CreateFixture(fixtureDef);
|
||||
}
|
||||
|
||||
Doll.prototype.setActionState = function(state) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue