Started revamp of the Tilemap system. Also removed old 'Advanced Physics' and dropped in p2.js which is what I hope we'll eventually use.

This commit is contained in:
photonstorm
2013-10-11 04:42:11 +01:00
parent a7230aa769
commit b868c2cb1b
72 changed files with 6704 additions and 6454 deletions
+50
View File
@@ -0,0 +1,50 @@
Phaser.Tileset = function (key, tileWidth, tileHeight) {
/**
* @property {string} key - The cache ID.
*/
this.key = key;
this.tilewidth = tileWidth;
this.tileHeight = tileHeight;
this._tiles = [];
}
Phaser.Tileset.prototype = {
addTile: function (tile) {
this._tiles.push(tile);
return tile;
},
getTile: function (index) {
if (this._tiles[index])
{
return this._tiles[index];
}
return null;
}
}
/**
* @name Phaser.Tileset#total
* @property {number} total - The total number of tiles in this Tileset.
* @readonly
*/
Object.defineProperty(Phaser.Tileset.prototype, "total", {
get: function () {
return this._ties.length;
}
});