Class Collectable
java.lang.Object
de.tum.cit.fop.maze.objects.GameObject
de.tum.cit.fop.maze.objects.collectables.Collectable
Base class for collectables that can be picked up by the player.
-
Field Summary
Fields inherited from class de.tum.cit.fop.maze.objects.GameObject
bounds, currentAnimationType, drawable, position, sizes, speed, speedMultiplier, spriteSizes, texture, velocity -
Constructor Summary
ConstructorsConstructorDescriptionCollectable(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 Summary
Modifier and TypeMethodDescriptionvoidanimate(com.badlogic.gdx.graphics.g2d.Batch batch) Renders the object using its drawable or texture.booleancheckPlayerCollision(Player player, HUD hud) Checks collision with player and triggers pickup.protected abstract voidMethods inherited from class de.tum.cit.fop.maze.objects.GameObject
changeAnimation, entitiesOverlap, getBounds, getDrawable, getSize, getSpeed, getVelocity, increaseSpeed, move, multiplySpeed, nextPosition, setAnimationTime, updateAnimation
-
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:GameObjectRenders the object using its drawable or texture.- Overrides:
animatein classGameObject- Parameters:
batch- Sprite batch for rendering
-
onPickUp
-
checkPlayerCollision
Checks collision with player and triggers pickup.- Parameters:
player- The playerhud- HUD for UI updates- Returns:
- True if collected
-