Class Minimap

java.lang.Object
dev.kyzel.game.world.tile.Minimap

public class Minimap extends Object
A class to handle minimap.
  • Field Details

    • render

      private Renderer render
      The Renderer where the minimap will be drawn on.
    • game

      private Game game
      The Game where the minimap will take information from.
    • worldTiles

      private Tile[][] worldTiles
      The list of all tiles in the game.
    • maxRow

      private int maxRow
      The max number of rows of the tiles list.
    • maxCol

      private int maxCol
      The max number of columns of tiles list.
    • worldMap

      BufferedImage worldMap
      The output minimap.
    • mapSize

      private int mapSize
      The minimap's size.
  • Constructor Details

    • Minimap

      public Minimap(Renderer render, Game game, int mapSize)
      Creates a new minimap.
      Parameters:
      render - the Renderer where the minimap will be drawn on
      game - Game where the minimap will take information from
      mapSize - the minimap's size
  • Method Details

    • getMapSize

      public int getMapSize()
      Gets the minimap's size.
      Returns:
      the minimap's size
    • setMapSize

      public void setMapSize(int mapSize)
      Set the minimap's size to the given value.
      Parameters:
      mapSize - the given value
    • update

      public void update()
      Updates the minimap.
    • createMinimap

      public void createMinimap()
      Creates the minimap.
    • draw

      public void draw(Graphics g)
      Draws the minimap.
      Parameters:
      g - the Graphics which is used to draw