Class: World

World

FM.World

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
Author:
  • Simon Chauvin
Source:

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.
Source:

getTileMapFromType(pType) → {FM.TileMap}

Retrieve the tile map from the given type.
Parameters:
Name Type Description
pType FM.ObjectType The type of the tile map to retrieve.
Source:
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.
Source:
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
pTileMap FM.TileMap Tile map to add.
pMap FM.TmxMap TmxMap containing the tile map data.
pLayerName string Name of the layer of the tile map.
pTileSetName string Name of the tile set to use.
Source: