Class Collectable

java.lang.Object
io.github.team6ENG.EscapeUni.Collectable

public class Collectable extends Object
Represents collectable game items
  • Field Details

    • playerHas

      public boolean playerHas
    • img

      public com.badlogic.gdx.scenes.scene2d.ui.Image img
    • x

      public float x
    • y

      public float y
    • isVisible

      public boolean isVisible
    • originScreen

      public String originScreen
  • Constructor Details

    • Collectable

      public Collectable(Main game, String path, float x, float y, float scale, boolean isVisible, String originScreen, AudioManager audioManager)
  • Method Details

    • checkInRange

      public boolean checkInRange(float playerX, float playerY)
      Check if player is in range
      Parameters:
      playerX -
      playerY -
      Returns:
      true if in range
    • Collect

      public void Collect()
      Mark as collected and scale to inventory bar size
    • playSound

      public void playSound()
      play sound