mirror of
https://github.com/wassname/phaser.git
synced 2026-08-10 12:30:48 +08:00
Extracting the correct area from a layer, debug displaying it and preparing for collision.
This commit is contained in:
+33
-1
@@ -36,11 +36,43 @@ Phaser.Tileset.prototype = {
|
||||
|
||||
},
|
||||
|
||||
canCollide: function (index) {
|
||||
|
||||
if (this.tiles[index])
|
||||
{
|
||||
return this.tiles[index].collideNone;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
},
|
||||
|
||||
checkTileIndex: function (index) {
|
||||
|
||||
return (this.tiles[index]);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
setCollisionRange: function (start, stop, left, right, up, down) {
|
||||
|
||||
if (this.tiles[start] && this.tiles[stop] && start < stop)
|
||||
{
|
||||
for (var i = start; i <= stop; i++)
|
||||
{
|
||||
this.tiles[i].setCollision(left, right, up, down);
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
setCollision: function (index, left, right, up, down) {
|
||||
|
||||
if (this.tiles[index])
|
||||
{
|
||||
this.tiles[index].setCollision(left, right, up, down);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user