Class UpdateBuildingDirection

java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.building.UpdateBuildingDirection

public class UpdateBuildingDirection extends Component
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.
  • Constructor Details

    • UpdateBuildingDirection

      public UpdateBuildingDirection(Entity target)
  • 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.
      Overrides:
      create in class Component
    • 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.
      Overrides:
      update in class Component