All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public class Key extends Collectable
Represents a Key collectable object in the game. This class extends the Collectable class.
  • Constructor Details

    • Key

      public Key(com.badlogic.gdx.math.Vector2 position, com.badlogic.gdx.physics.box2d.World world, box2dLight.RayHandler rayHandler, com.badlogic.gdx.graphics.g2d.TextureAtlas textureAtlas)
      Represents a Key collectable object in the game. This class extends the Collectable class.
  • Method Details

    • render

      public void render(com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch)
      Description copied from class: GameElement
      Renders the appearance of the game object
      Specified by:
      render in class GameElement
    • collect

      public void collect(Player player)
      Collects the key from the player and updates the state of the key.
      Specified by:
      collect in class Collectable
      Parameters:
      player - the player object that collects the key