Package com.csse3200.game.components
Class ProximityComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.ProximityComponent
Component class for spawning enemies when the player gets within a certain proximity.
Enemies exits before this, but are disabled until the player enters their proximity.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
update()
Updates the task's state based on the entity's position relative to the target.Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
ProximityComponent
- Parameters:
target
- the player entity, for detecting if it is in rangeproximityRange
- the range in which the player will cause the entity to trigger the spawn animation and become enabled.
-
-
Method Details