forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessTileCallbacks.js
More file actions
35 lines (32 loc) · 989 Bytes
/
Copy pathProcessTileCallbacks.js
File metadata and controls
35 lines (32 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* [description]
*
* @function Phaser.Physics.Arcade.Tilemap.ProcessTileCallbacks
* @since 3.0.0
*
* @param {Phaser.Tilemaps.Tilemap} tile - [description]
* @param {Phaser.GameObjects.Sprite} sprite - [description]
*
* @return {boolean} [description]
*/
var ProcessTileCallbacks = function (tile, sprite)
{
// Tile callbacks take priority over layer level callbacks
if (tile.collisionCallback)
{
return !tile.collisionCallback.call(tile.collisionCallbackContext, sprite, tile);
}
else if (tile.layer.callbacks[tile.index])
{
return !tile.layer.callbacks[tile.index].callback.call(
tile.layer.callbacks[tile.index].callbackContext, sprite, tile
);
}
return true;
};
module.exports = ProcessTileCallbacks;