Package com.dicycat.kroy.gamemap
Class TiledGameMap
- java.lang.Object
-
- com.dicycat.kroy.gamemap.TiledGameMap
-
public class TiledGameMap extends java.lang.Object
- Author:
- Martha Cartwright
-
-
Constructor Summary
Constructors Constructor Description TiledGameMap()
-
Method Summary
Modifier and Type Method Description void
dispose()
int
getHeight()
Gets the height of the map in tilesint
getLayers()
Get the number of layers in the mapint
getPixelHeight()
Gets the height of the map in pixelsint
getPixelWidth()
Gets the width of the map in pixelsTileType
getTileTypeByCoordinate(int layer, int col, int row)
Gets the tile type at a row/column for a particular layerTileType
getTileTypeByLocation(int layer, float x, float y)
Gets the tile type at a pixel position for a particular layerint
getWidth()
Gets the width of the map in tilesvoid
renderBuildings(com.badlogic.gdx.graphics.OrthographicCamera camera)
Renders the building layer and the window layer of the mapvoid
renderRoads(com.badlogic.gdx.graphics.OrthographicCamera camera)
Renders the road layer of the mapvoid
update(float delta)
-
-
-
Method Detail
-
renderRoads
public void renderRoads(com.badlogic.gdx.graphics.OrthographicCamera camera)
Renders the road layer of the map- Parameters:
camera
- Active camera
-
renderBuildings
public void renderBuildings(com.badlogic.gdx.graphics.OrthographicCamera camera)
Renders the building layer and the window layer of the map- Parameters:
camera
- Active camera
-
update
public void update(float delta)
-
dispose
public void dispose()
-
getTileTypeByCoordinate
public TileType getTileTypeByCoordinate(int layer, int col, int row)
Gets the tile type at a row/column for a particular layer- Parameters:
layer
- Layer to checkcol
- Column where tile is locatedrow
- Row where tile is located- Returns:
- tileType The type of tile at the given location of the given layer
-
getTileTypeByLocation
public TileType getTileTypeByLocation(int layer, float x, float y)
Gets the tile type at a pixel position for a particular layer- Parameters:
layer
- Layer to checkx
- X positiony
- Y position- Returns:
- tileType The type of tile at the given location of the given layer
-
getWidth
public int getWidth()
Gets the width of the map in tiles- Returns:
- width Map tile width
-
getHeight
public int getHeight()
Gets the height of the map in tiles- Returns:
- height Map tile height
-
getLayers
public int getLayers()
Get the number of layers in the map- Returns:
- Number of layers
-
getPixelWidth
public int getPixelWidth()
Gets the width of the map in pixels- Returns:
- width Map pixel width
-
getPixelHeight
public int getPixelHeight()
Gets the height of the map in pixels- Returns:
- height Map pixel height
-
-