Package io.github.team6ENG.EscapeUni
Class Collectable
java.lang.Object
io.github.team6ENG.EscapeUni.Collectable
Represents collectable game items
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCollectable(Main game, String path, float x, float y, float scale, boolean isVisible, String originScreen, AudioManager audioManager) -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckInRange(float playerX, float playerY) Check if player is in rangevoidCollect()Mark as collected and scale to inventory bar sizevoidplay sound
-
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
-
-
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
-