Package de.tum.cit.fop.maze.effects
Class Effect
java.lang.Object
de.tum.cit.fop.maze.effects.Effect
- Direct Known Subclasses:
Buff,Dash,DashCooldown,Flicker,FlickerHidden,Freeze,GodMode,Invis,InvisCooldown,Poison,Sunscreen
Abstract base class for all status effects applied to the player.
Handles the duration and lifecycle (start, tick, end) of effects.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
player
The player affected by this effect. -
timeLeft
protected float timeLeftThe remaining time for this effect.
-
-
Constructor Details
-
Effect
public Effect()
-
-
Method Details
-
getTimeLeft
public float getTimeLeft()Gets the remaining time of the effect.- Returns:
- The time left in seconds.
-
onStart
public abstract void onStart()Called when the effect is first applied. -
onTick
public boolean onTick(float deltaTime) Called every frame to update the effect.- Parameters:
deltaTime- The time elapsed since the last frame.- Returns:
- True if the effect has expired, false otherwise.
-
onEnd
public abstract void onEnd()Called when the effect expires or is removed.
-