File tree Expand file tree Collapse file tree
v3/src/gameobjects/tilemap Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 *
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments