new World(pWidth, pHeight)
World represent the concrete space of the game.
Parameters:
| Name | Type | Description |
|---|---|---|
pWidth |
int | Width of the tile map in pixels |
pHeight |
int | Height of the tile map in pixels |
Extends
Members
-
height :int
-
Height of the rectangle.
Type:
- int
- Inherited From:
- Source:
-
width :int
-
Width of the rectangle.
Type:
- int
- Inherited From:
- Source:
-
x :int
-
x position.
Type:
- int
- Inherited From:
- Source:
-
y :int
-
y position.
Type:
- int
- Inherited From:
- Source:
Methods
-
destroy()
-
Destroy the world and its objects.
-
getTileMapFromType(pType) → {FM.TileMap}
-
Retrieve the tile map from the given type.
Parameters:
Name Type Description pTypeFM.ObjectType The type of the tile map to retrieve. Returns:
The tile map corresponding to the given type or null if none is found.- Type
- FM.TileMap
-
hasTileCollisions() → {boolean}
-
Check if a tile map allow collisions.
Returns:
Whether there is a tile map with potential collisions or not.- Type
- boolean
-
loadTileMap(pTileMap, pMap, pLayerName, pTileSetName)
-
Add a tile map to the current world.
Parameters:
Name Type Description pTileMapFM.TileMap Tile map to add. pMapFM.TmxMap TmxMap containing the tile map data. pLayerNamestring Name of the layer of the tile map. pTileSetNamestring Name of the tile set to use.