Class ProjectileBoundsComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.physics.components.ProjectileBoundsComponent
This component ensures that the projectile entity is disposed off when the laser leaves the
boundaries of the game window/map. The worldWidth and worldHeight variables are required to
establish the game boundaries. update() checks the current position of the entity(i.e. laser) and
disposes it if out of bounds.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
update()
Called once per frame of the game, and should be used for most component logic.Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, getPriority, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
ProjectileBoundsComponent
public ProjectileBoundsComponent(float worldWidth, float worldHeight)
-
-
Method Details