Phaser.CANVAS_PX_ROUND is a boolean. If 'true' the Canvas renderer will Math.floor() all coordinates before drawImage, stopping pixel interpolation. Defaults to false.

Phaser.CANVAS_CLEAR_RECT is a boolean. If 'true' (the default) it will context.clearRect() every frame. If false this is skipped (useful if you know you don't need it)
Collision now works between Sprites positioned via sprite.x/y, sprite.body.x/y or sprite.body.velocity.
If you are tweening a sprite and still want physics collision, set `sprite.body.moves = false` otherwise it will fight against the tween motion.
This commit is contained in:
photonstorm
2014-01-31 04:14:02 +00:00
parent 68b7d22e0d
commit 13a86765cb
6 changed files with 101 additions and 41 deletions
+7 -7
View File
@@ -1273,19 +1273,19 @@ if (this.sprite.debug)
this.facing = Phaser.DOWN;
}
// this.updateBounds();
if (this.sprite.debug)
{
console.log('Body postUpdate x:', this.x, 'y:', this.y, 'left:', this.left, 'right:', this.right, 'WAS', this.preX, this.preY);
console.log('Body postUpdate blocked:', this.blocked, this.blockFlags);
console.log('Body postUpdate velocity:', this.velocity.x, this.velocity.y);
console.log('Body postUpdate Sprite:', this.sprite.x, this.sprite.y, 'cached', this.sprite._cache.x, this.sprite._cache.y);
}
this.sprite.x = this.x - this.offset.x;
this.sprite.y = this.y - this.offset.y;
this.sprite.worldTransform[2] = this.x - this.offset.x;
this.sprite.worldTransform[5] = this.y - this.offset.y;
if (this.deltaX() !== 0 || this.deltaY() !== 0)
{
this.sprite.worldTransform[2] = this.sprite.x = (this.x - this.offset.x);
this.sprite.worldTransform[5] = this.sprite.y = (this.y - this.offset.y);
}
if (this.allowRotation)
{
@@ -1319,7 +1319,7 @@ if (this.sprite.debug)
this.mass = 1;
this.friction = 0.1;
this.checkCollision = { none: false, any: true, up: true, down: true, left: true, right: true };
this.blocked
this.blocked = { x: 0, y: 0, up: false, down: false, left: false, right: false };
},