Class WorldMapPlayerComponent

All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, Renderable, Comparable<Renderable>

public class WorldMapPlayerComponent extends UIComponent
Handles player movement and interaction on the world map
  • Constructor Details

    • WorldMapPlayerComponent

      public WorldMapPlayerComponent(com.badlogic.gdx.math.Vector2 worldSize)
  • Method Details

    • create

      public void create()
      Description copied from class: Component
      Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.
      Overrides:
      create in class UIComponent
    • update

      public void update()
      Description copied from class: Component
      Called once per frame of the game, and should be used for most component logic. Not called if component is disabled.
      Overrides:
      update in class Component
    • getNearbyNode

      public WorldMapNode getNearbyNode()
      Gets the nearby node.
      Returns:
      the nearby node
    • draw

      protected void draw(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
      Draws the player texture at the world coordinates with appropriate size.
      Specified by:
      draw in class RenderComponent
      Parameters:
      batch - the sprite batch
    • dispose

      public void dispose()
      Clean up any running background tasks when the component is disposed.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class RenderComponent