Class Collectable

java.lang.Object
de.tum.cit.fop.maze.objects.GameObject
de.tum.cit.fop.maze.objects.collectables.Collectable
Direct Known Subclasses:
Heart, Key

public abstract class Collectable extends GameObject
Base class for collectables that can be picked up by the player.
  • Constructor Details

    • Collectable

      public Collectable(com.badlogic.gdx.math.Vector2 startPos, com.badlogic.gdx.math.Vector2 sizes, com.badlogic.gdx.math.Vector2 spriteSizes, com.badlogic.gdx.math.Vector2 spriteShift, AnimationType animationType)
  • Method Details

    • animate

      public void animate(com.badlogic.gdx.graphics.g2d.Batch batch)
      Description copied from class: GameObject
      Renders the object using its drawable or texture.
      Overrides:
      animate in class GameObject
      Parameters:
      batch - Sprite batch for rendering
    • onPickUp

      protected abstract void onPickUp(Player player, HUD hud)
    • checkPlayerCollision

      public boolean checkPlayerCollision(Player player, HUD hud)
      Checks collision with player and triggers pickup.
      Parameters:
      player - The player
      hud - HUD for UI updates
      Returns:
      True if collected