mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 23:24:41 +00:00
Fixed Tile callback check in Arcade Physics (fix #562)
This commit is contained in:
parent
ec2275e18c
commit
b9ac0d565e
4 changed files with 16 additions and 3 deletions
|
@ -63,6 +63,7 @@ Bug Fixes
|
|||
* Fixed the IE11 version check (fixes #579)
|
||||
* Ninja world collision to check right and bottom bounds (thanks dreadhorse, fix #571)
|
||||
* Group enableBody parameter was incorrectly assigned to the debug var (thanks BurnedToast, fix #565)
|
||||
* Fixed Tile callback check in Arcade Physics (fix #562)
|
||||
|
||||
|
||||
Version 2.0.0 - "Aes Sedai" - March 13th 2014
|
||||
|
|
|
@ -956,6 +956,7 @@ Phaser.Physics.Arcade.prototype = {
|
|||
}
|
||||
|
||||
// They overlap. Any custom callbacks?
|
||||
/*
|
||||
if (tile.collisionCallback || tile.layer.callbacks[tile.index])
|
||||
{
|
||||
// A local callback takes priority over a global callback.
|
||||
|
@ -970,6 +971,17 @@ Phaser.Physics.Arcade.prototype = {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (tile.collisionCallback)
|
||||
{
|
||||
// A local callback takes priority over a global callback.
|
||||
if (tile.collisionCallbackk && tile.collisionCallback.call(tile.collisionCallbackContext, body.sprite, tile) === false)
|
||||
{
|
||||
// Is there a tile specific collision callback? If it returns true then we can carry on, otherwise we should abort.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var ox = 0;
|
||||
var oy = 0;
|
||||
|
|
|
@ -271,7 +271,7 @@ Phaser.Tile.prototype = {
|
|||
if (collides && faces)
|
||||
{
|
||||
// Does this tile have any collide flags OR interesting face?
|
||||
return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.faceTop || this.faceBottom || this.faceLeft || this.faceRight || this.collisionCallback || this.layer.callbacks[this.index]);
|
||||
return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.faceTop || this.faceBottom || this.faceLeft || this.faceRight || this.collisionCallback);
|
||||
}
|
||||
else if (collides)
|
||||
{
|
||||
|
@ -335,7 +335,7 @@ Object.defineProperty(Phaser.Tile.prototype, "collides", {
|
|||
Object.defineProperty(Phaser.Tile.prototype, "canCollide", {
|
||||
|
||||
get: function () {
|
||||
return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback || this.layer.callbacks[this.index]);
|
||||
return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback);
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -318,7 +318,7 @@ Phaser.Tilemap.prototype = {
|
|||
countX = 0;
|
||||
countY++;
|
||||
|
||||
if (countY === set.rows)
|
||||
if (countY === newSet.rows)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue