Class PlayerHighlightComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.player.PlayerHighlightComponent
All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable

public class PlayerHighlightComponent extends Component
Component that renders a highlight on current player cursor position Is bounded by the maximum "reach" of the player. Also recognises when it should be muted via listeners.
  • Constructor Details

    • PlayerHighlightComponent

      public PlayerHighlightComponent()
      Creates the component and sets the muted boolean to false
  • Method Details

    • create

      public void create()
      Creates the component and adds listeners for when the player enters and exits the tractor
      Overrides:
      create in class Component
    • mute

      public void mute()
      Mutes the player highlight (OFF)
    • unMute

      public void unMute()
      Unmutes the player highlight (highlight ON)
    • isMuted

      public boolean isMuted()
      Returns the muted boolean
      Returns:
      true if playerHighlight is muted (highlight is off)
    • updatePosition

      public void updatePosition()
      Updates the position of the player highlight to the current player cursor position Handles translating mouse pos to world pos And "locking" it to the closest tile Indicates which tile the player is currently going to act on
    • update

      public void update()
      Updates player highlight
      Overrides:
      update in class Component
    • getTexturePath

      public String getTexturePath()
      Returns the path to the texture
      Returns:
      path to texture