Final 1.0.5 release.

This commit is contained in:
Richard Davey
2013-09-20 13:55:33 +01:00
parent 9e88da5c66
commit a415e779d1
12 changed files with 494 additions and 379 deletions
+15 -3
View File
@@ -7,6 +7,8 @@ Phaser.Physics.Arcade.Body = function (sprite) {
this.x = sprite.x;
this.y = sprite.y;
this.lastX = sprite.x;
this.lastY = sprite.y;
// un-scaled original size
this.sourceWidth = sprite.currentFrame.sourceSizeW;
@@ -62,9 +64,6 @@ Phaser.Physics.Arcade.Body = function (sprite) {
this.collideWorldBounds = false;
this.lastX = sprite.x;
this.lastY = sprite.y;
};
Phaser.Physics.Arcade.Body.prototype = {
@@ -102,8 +101,11 @@ Phaser.Physics.Arcade.Body.prototype = {
this.lastY = this.y;
this.rotation = this.sprite.angle;
// There is a bug here in that the worldTransform values are what should be used, otherwise the quadTree gets the wrong rect given to it
this.x = (this.sprite.x - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.y = (this.sprite.y - (this.sprite.anchor.y * this.height)) + this.offset.y;
// this.x = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
// this.y = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
if (this.moves)
{
@@ -122,6 +124,16 @@ Phaser.Physics.Arcade.Body.prototype = {
this.game.physics.quadTree.insert(this);
}
if (this.deltaX() != 0)
{
this.sprite.x -= this.deltaX();
}
if (this.deltaY() != 0)
{
this.sprite.y -= this.deltaY();
}
// Adjust the sprite based on all of the above, so the x/y coords will be correct going into the State update
this.sprite.x = this.x - this.offset.x + (this.sprite.anchor.x * this.width);
this.sprite.y = this.y - this.offset.y + (this.sprite.anchor.y * this.height);