Skip to content

Commit 8ee9805

Browse files
committed
work in progress on Static Body offset functionality... should Sprite.setPosition(x,y) effect Sprites static body?
1 parent 97cd94b commit 8ee9805

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/physics/arcade/StaticBody.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,14 @@ var StaticBody = new Class({
443443

444444
this.world.staticTree.remove(this);
445445

446+
this.position.x -= this.offset.x;
447+
this.position.y -= this.offset.y;
448+
446449
this.offset.set(x, y);
447450

451+
this.position.x += this.offset.x;
452+
this.position.y += this.offset.y;
453+
448454
this.updateCenter();
449455

450456
this.world.staticTree.insert(this);

0 commit comments

Comments
 (0)