Package com.csse3200.game.rendering
Class BlinkComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.rendering.BlinkComponent
- All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Initializes the BlinkComponent and adds an event listener for handling "hit" events.com.badlogic.gdx.graphics.Color
getColor()
Gets the color used for rendering the entity during the blink effect.boolean
Checks whether the entity is currently blinking.void
update()
Updates the entity's blinking effect over time, interpolating color opacity.Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, read, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, write
-
Constructor Details
-
BlinkComponent
public BlinkComponent()
-
-
Method Details
-
create
public void create()Initializes the BlinkComponent and adds an event listener for handling "hit" events. -
getColor
public com.badlogic.gdx.graphics.Color getColor()Gets the color used for rendering the entity during the blink effect.- Returns:
- The Color object representing the entity's color.
-
isBlinking
public boolean isBlinking()Checks whether the entity is currently blinking.- Returns:
true
if the entity is blinking;false
otherwise.
-
update
public void update()Updates the entity's blinking effect over time, interpolating color opacity.
-