Phaser.Component.PhysicsBody = function (){ } ; Phaser.Component.PhysicsBody.preUpdate = function (){ if (this.fresh && this.exists) { this.world.setTo(this.parent.position.x + this.position.x, this.parent.position.y + this.position.y); this.worldTransform.tx = this.world.x; this.worldTransform.ty = this.world.y; this.previousPosition.set(this.world.x, this.world.y); this.previousRotation = this.rotation; if (this.body) { this.body.preUpdate(); } this.fresh = false ; return false ; } this.previousPosition.set(this.world.x, this.world.y); this.previousRotation = this.rotation; if (!this._exists || !this.parent.exists) { this.renderOrderID = -1; return false ; } return true ; } ; Phaser.Component.PhysicsBody.postUpdate = function (){ if (this.exists && this.body) { this.body.postUpdate(); } } ; Phaser.Component.PhysicsBody.prototype = { body: null , x: { get: function (){ return this.position.x; } , set: function (value){ this.position.x = value; if (this.body && !this.body.dirty) { this.body._reset = true ; } } } , y: { get: function (){ return this.position.y; } , set: function (value){ this.position.y = value; if (this.body && !this.body.dirty) { this.body._reset = true ; } } } } ;