Class PlayerEquipComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.player.PlayerEquipComponent

public class PlayerEquipComponent extends Component
A component that makes an item follow the player at a given offset.
  • Constructor Details

    • PlayerEquipComponent

      public PlayerEquipComponent()
  • Method Details

    • update

      public void update()
      Updates the item's position so it follows the player
      Overrides:
      update in class Component
    • setItem

      public void setItem(Entity item, com.badlogic.gdx.math.Vector2 offset)
      This function replaces the currently equipped item with a new one
      Parameters:
      item - The entity created of the item that needs to be equipped
      offset - Where from the players current position to draw the weapon