Skip to content

Commit ed56fbc

Browse files
committed
Merge branch 'master' of https://github.com/photonstorm/phaser
2 parents 04844a7 + 10dfa0a commit ed56fbc

3 files changed

Lines changed: 14 additions & 19 deletions

File tree

v3/src/gameobjects/tilemap/Tile.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,6 @@ var Tile = new Class({
139139
*/
140140
this.collideDown = false;
141141

142-
/**
143-
* An array of collision objects from Tiled. These are defined on the tileset. Each tile
144-
* just gets a references to the objects stored in the tileset, so this is readonly.
145-
* @property {array|null} collisionObjects
146-
* @readonly
147-
*/
148-
this.collisionObjects = null;
149-
150142
/**
151143
* Whether the tile's left edge is interesting for collisions.
152144
* @property {boolean} faceLeft

v3/src/gameobjects/tilemap/Tileset.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ var Tileset = new Class({
147147
return this.tileData[tileIndex - this.firstgid];
148148
},
149149

150+
/**
151+
* Get a tile's data that is stored in the Tileset. Returns null if tile index is not
152+
* contained in this Tileset.
153+
*
154+
* @param {integer} tileIndex - The unique id of the tile across all tilesets in the map.
155+
* @returns {object|null}
156+
*/
157+
getTileCollisionGroup: function (tileIndex)
158+
{
159+
var data = this.getTileData(tileIndex);
160+
return (data && data.objectgroup) ? data.objectgroup : null;
161+
},
162+
163+
150164
/**
151165
* Returns true if and only if this Tileset contains the given tile index.
152166
*

v3/src/gameobjects/tilemap/parsers/parsetiledjson/AssignTileProperties.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ var AssignTileProperties = function (mapData)
4747
tile.properties, set.tileProperties[tile.index - set.firstgid]
4848
);
4949
}
50-
51-
// If that tile type has any collision info, add that to the tile object
52-
if (set.tileData && set.tileData[tile.index - set.firstgid])
53-
{
54-
var tileData = set.tileData[tile.index - set.firstgid];
55-
var objects = GetValue(tileData, 'objectgroup.objects', null);
56-
if (objects && objects.length > 0)
57-
{
58-
tile.collisionObjects = objects;
59-
}
60-
}
6150
}
6251
}
6352
}

0 commit comments

Comments
 (0)