Preparing for 1.0.6 release, but moving physics changes to dev.

This commit is contained in:
Richard Davey
2013-09-24 15:28:29 +01:00
parent 51049128f5
commit 891369b197
10 changed files with 824 additions and 313 deletions
+2 -2
View File
@@ -138,6 +138,8 @@ Phaser.Tilemap.prototype.parseTiledJSON = function (json, key) {
continue;
}
// layer.createQuadTree(json.tilewidth * json.layers[i].width, json.tileheight * json.layers[i].height);
layer.alpha = json.layers[i].opacity;
layer.visible = json.layers[i].visible;
layer.tileMargin = json.tilesets[0].margin;
@@ -183,8 +185,6 @@ Phaser.Tilemap.prototype.parseTiledJSON = function (json, key) {
*/
Phaser.Tilemap.prototype.generateTiles = function (qty) {
console.log('generating', qty, 'tiles');
for (var i = 0; i < qty; i++)
{
this.tiles.push(new Phaser.Tile(this.game, this, i, this.currentLayer.tileWidth, this.currentLayer.tileHeight));
+8
View File
@@ -87,6 +87,8 @@ Phaser.TilemapLayer = function (parent, id, key, mapFormat, name, tileWidth, til
this._alpha = 1;
this.quadTree = null;
this.canvas = null;
this.context = null;
this.baseTexture = null;
@@ -472,6 +474,12 @@ Phaser.TilemapLayer.prototype = {
this.parent.addChild(this.sprite);
},
createQuadTree: function (width, height) {
this.quadTree = new Phaser.QuadTree(this, 0, 0, width, height, 20, 4);
},
/**
+7
View File
@@ -112,8 +112,15 @@ Phaser.TilemapRenderer.prototype = {
layer.tileWidth,
layer.tileHeight
);
if (tilemap.tiles[this._columnData[tile]].collideNone == false)
{
layer.context.fillStyle = 'rgba(255,255,0,0.5)';
layer.context.fillRect(this._tx, this._ty, layer.tileWidth, layer.tileHeight);
}
}
this._tx += layer.tileWidth;
}