Class UpdateBuildingDirection
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.building.UpdateBuildingDirection
There are stationary buildings (trebuchet)
in the game that change their sprite depending
on what direction their target is in, this
component implements similar direction detection
as PhysicsMovementComponent, but for stationary
entities.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.deco2800.game.components.Component
dispose, earlyUpdate, getEntity, isAnimationRenderComponent, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Constructor Details
-
UpdateBuildingDirection
-
-
Method Details
-
create
public void create()Description copied from class:Component
Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished. -
update
public void update()Checks the direction building is pointing in relation to assigned target. It is assumed that any building that used this component has a target.
-