Package de.tum.cit.fop.maze.objects
Class Dawn
java.lang.Object
de.tum.cit.fop.maze.objects.GameObject
de.tum.cit.fop.maze.objects.Dawn
Represents a dawn hazard that damages players after activating.
-
Field Summary
FieldsFields inherited from class de.tum.cit.fop.maze.objects.GameObject
bounds, currentAnimationType, drawable, position, sizes, speed, speedMultiplier, spriteSizes, texture, velocity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckPlayerCollision(Player player) Checks collision with player and applies damage.static voidspawnNewDawn(float delta, GameField gamefield, com.badlogic.gdx.math.Vector2 playerPosition, List<GameObject> gameObjects) Spawns a new dawn near the player position.booleanupdateDawn(float delta) Updates dawn state and checks for removal.Methods inherited from class de.tum.cit.fop.maze.objects.GameObject
animate, changeAnimation, entitiesOverlap, getBounds, getDrawable, getSize, getSpeed, getVelocity, increaseSpeed, move, multiplySpeed, nextPosition, setAnimationTime, updateAnimation
-
Field Details
-
timeLeftBeforeRemoved
public float timeLeftBeforeRemoved
-
-
Constructor Details
-
Dawn
public Dawn(com.badlogic.gdx.math.Vector2 startPos)
-
-
Method Details
-
spawnNewDawn
public static void spawnNewDawn(float delta, GameField gamefield, com.badlogic.gdx.math.Vector2 playerPosition, List<GameObject> gameObjects) Spawns a new dawn near the player position.- Parameters:
delta- Time deltagamefield- Game field for placementplayerPosition- Player's current positiongameObjects- List to add dawn to
-
updateDawn
public boolean updateDawn(float delta) Updates dawn state and checks for removal.- Parameters:
delta- Time delta- Returns:
- True if dawn should be removed
-
checkPlayerCollision
Checks collision with player and applies damage.- Parameters:
player- The player to check- Returns:
- True if player was damaged
-