Testing some new Camera tricks.

This commit is contained in:
Richard Davey
2013-10-03 23:20:24 +01:00
parent c8760b4341
commit 54f073e5cb
12 changed files with 171 additions and 24 deletions
+8 -8
View File
@@ -419,16 +419,16 @@ Phaser.Sprite.prototype.postUpdate = function() {
if (this.exists)
{
// The sprite is positioned in this call, after taking into consideration motion updates and collision
this.body.postUpdate();
// this.body.postUpdate();
this._cache.x = this.x - (this.game.world.camera.x * this.scrollFactor.x);
this._cache.y = this.y - (this.game.world.camera.y * this.scrollFactor.y);
// this._cache.x = this.x - (this.game.world.camera.x * this.scrollFactor.x);
// this._cache.y = this.y - (this.game.world.camera.y * this.scrollFactor.y);
if (this.position.x != this._cache.x || this.position.y != this._cache.y)
{
this.position.x = this._cache.x;
this.position.y = this._cache.y;
}
// if (this.position.x != this._cache.x || this.position.y != this._cache.y)
// {
// this.position.x = this._cache.x;
// this.position.y = this._cache.y;
// }
}
}