Class PressurePlateComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.PressurePlateComponent

public class PressurePlateComponent extends Component
A pressure plate that toggles its pressed state when a player steps on it. The plate latches (stays pressed) until reset manually.
  • Constructor Details

    • PressurePlateComponent

      public PressurePlateComponent()
  • Method Details

    • create

      public void create()
      Called when component is created
      Overrides:
      create in class Component
    • setPlayerOnPlate

      public void setPlayerOnPlate(ColliderComponent collider)
      Updates the pressure plates pressed state when a collider steps on or off
      Parameters:
      collider -
    • setTextures

      public void setTextures(String unpressed, String pressed)
      Sets texture for pressed and unpressed state of the pressure plate
      Parameters:
      unpressed - texture for when unpressed
      pressed - texture for when pressed