Extracting the correct area from a layer, debug displaying it and preparing for collision.

This commit is contained in:
photonstorm
2013-10-15 05:41:42 +01:00
parent dd695e066f
commit f3ea68aad3
7 changed files with 551 additions and 253 deletions
+33 -1
View File
@@ -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);
}
},
}