Class MiniMap

java.lang.Object
de.tum.cit.ase.maze.screens.MiniMap
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public class MiniMap extends Object implements com.badlogic.gdx.utils.Disposable
The MiniMap class represents a mini map that can be displayed in a game screen. It displays the visited and not visited tiles on the map, as well as the player's position.

The mini map can be zoomed in, zoomed out, or turned off.

  • Constructor Details

    • MiniMap

      public MiniMap(GameScreen game, com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch, Player player)
      Represents a minimap for the game.
      Parameters:
      game - The game screen.
      spriteBatch - The sprite batch used for rendering.
      player - The player object.
  • Method Details

    • render

      public void render()
      Renders the mini map on the screen. It applies the given viewport and sets the projection matrix of the sprite batch and shape renderer.
    • update

      public void update(float dt)
      Updates the mini map based on the given delta time.
      Parameters:
      dt - the delta time.
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
    • resize

      public void resize(int width, int height)
      Resizes the mini map to the specified width and height.
      Parameters:
      width - The new width of the mini map.
      height - The new height of the mini map.
    • switchZoom

      public void switchZoom()
      Switches the zoom state of the mini map.
    • getZoomState

      public MiniMap.ZoomState getZoomState()
    • getViewport

      public com.badlogic.gdx.utils.viewport.Viewport getViewport()
    • setZoomState

      public void setZoomState(MiniMap.ZoomState zoomState)