Class WeaponArrowProjectileComponent

java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.combatitemscomponents.WeaponArrowProjectileComponent

public class WeaponArrowProjectileComponent extends Component
  • Constructor Details

    • WeaponArrowProjectileComponent

      public WeaponArrowProjectileComponent()
  • 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()
      Sets the projectile to move in a certain direction at a certain speed and updates the projectile to keep moving at that speed. Also disposes the arrow after 2 seconds by checking the duration of the projectile spawned.
      Overrides:
      update in class Component
    • setProjectileDirection

      public void setProjectileDirection(com.badlogic.gdx.math.Vector2 projectileDirection)
      Sets the projectile's direction
      Parameters:
      projectileDirection - the vector direction of the projectile's movement