Class 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 tiles
      int getLayers()
      Get the number of layers in the map
      int getPixelHeight()
      Gets the height of the map in pixels
      int getPixelWidth()
      Gets the width of the map in pixels
      TileType getTileTypeByCoordinate​(int layer, int col, int row)
      Gets the tile type at a row/column for a particular layer
      TileType getTileTypeByLocation​(int layer, float x, float y)
      Gets the tile type at a pixel position for a particular layer
      int getWidth()
      Gets the width of the map in tiles
      void renderBuildings​(com.badlogic.gdx.graphics.OrthographicCamera camera)
      Renders the building layer and the window layer of the map
      void renderRoads​(com.badlogic.gdx.graphics.OrthographicCamera camera)
      Renders the road layer of the map
      void update​(float delta)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TiledGameMap

        public TiledGameMap()
    • 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 check
        col - Column where tile is located
        row - 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 check
        x - X position
        y - 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