mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
parent
89c5e4a5d8
commit
ed23753c04
17 changed files with 286 additions and 224 deletions
|
|
@ -156,6 +156,10 @@ function (Parent, Box2D, Settings, CollisionDetector, Item) {
|
|||
this.setActionState("fall");
|
||||
}
|
||||
|
||||
Doll.prototype.kill = function() {
|
||||
this.body.SetFixedRotation(false);
|
||||
};
|
||||
|
||||
Doll.prototype.getPosition = function() {
|
||||
var pos = this.body.GetPosition();
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ function (Parent, Box2D, Settings, Exception) {
|
|||
|
||||
var bodyDef = new Box2D.Dynamics.b2BodyDef();
|
||||
bodyDef.type = Box2D.Dynamics.b2Body.b2_staticBody;
|
||||
bodyDef.position.x = this.options.x * Settings.TILE_SIZE / Settings.RATIO;
|
||||
bodyDef.position.y = this.options.y * Settings.TILE_SIZE / Settings.RATIO;
|
||||
bodyDef.position.x = (this.options.x * Settings.TILE_SIZE + Settings.TILE_SIZE / 2) / Settings.RATIO;
|
||||
bodyDef.position.y = (this.options.y * Settings.TILE_SIZE + Settings.TILE_SIZE / 2) / Settings.RATIO;
|
||||
bodyDef.angle = (this.options.r || 0) * 90 * Math.PI / 180;
|
||||
|
||||
return bodyDef;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue