Fixed Animation index 0 issue and hooked TilemapLayer to camera.

This commit is contained in:
photonstorm
2013-10-16 02:09:12 +01:00
parent fd5eeb9088
commit a97f271de7
15 changed files with 844 additions and 306 deletions
+10 -4
View File
@@ -10,6 +10,8 @@ Phaser.Physics.Arcade.Body = function (sprite) {
this.preX = sprite.x;
this.preY = sprite.y;
this.preRotation = sprite.angle;
this.screenX = sprite.x;
this.screenY = sprite.y;
// un-scaled original size
this.sourceWidth = sprite.currentFrame.sourceSizeW;
@@ -108,8 +110,10 @@ Phaser.Physics.Arcade.Body.prototype = {
this.embedded = false;
this.preX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.preY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
this.screenX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.screenY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
this.preX = (this.sprite.localTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.preY = (this.sprite.localTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
this.preRotation = this.sprite.angle;
this.x = this.preX;
@@ -233,8 +237,10 @@ Phaser.Physics.Arcade.Body.prototype = {
this.angularVelocity = 0;
this.angularAcceleration = 0;
this.preX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.preY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
// this.preX = (this.sprite.worldTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
// this.preY = (this.sprite.worldTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
this.preX = (this.sprite.localTransform[2] - (this.sprite.anchor.x * this.width)) + this.offset.x;
this.preY = (this.sprite.localTransform[5] - (this.sprite.anchor.y * this.height)) + this.offset.y;
this.preRotation = this.sprite.angle;
this.x = this.preX;