Class HealthCollectable

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

public class HealthCollectable extends Collectable
Collectable that restores the health of the player by HEALTH_TO_RESTORE
  • Constructor Details

    • HealthCollectable

      public HealthCollectable(com.badlogic.gdx.math.Vector2 position, com.badlogic.gdx.physics.box2d.World world, box2dLight.RayHandler rayHandler, com.badlogic.gdx.graphics.g2d.TextureAtlas textureAtlas)
  • Method Details

    • collect

      public void collect(Player player)
      Description copied from class: Collectable
      Called when a Player is collects it.
      Specified by:
      collect in class Collectable
      Parameters:
      player - the Player that collected it
    • 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
    • update

      public void update(float deltaTime)
      Description copied from class: GameElement
      Updates the Object
      Overrides:
      update in class Collectable
      Parameters:
      deltaTime - Time since last frame.
    • dispose

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class Collectable