Package com.csse3200.game.components
Class PressurePlateComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.PressurePlateComponent
A pressure plate that toggles its pressed state when a player steps on it.
The plate latches (stays pressed) until reset manually.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Called when component is createdvoidsetPlayerOnPlate(ColliderComponent collider) Updates the pressure plates pressed state when a collider steps on or offvoidsetTextures(String unpressed, String pressed) Sets texture for pressed and unpressed state of the pressure plateMethods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, getPrio, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
PressurePlateComponent
public PressurePlateComponent()
-
-
Method Details
-
create
public void create()Called when component is created -
setPlayerOnPlate
Updates the pressure plates pressed state when a collider steps on or off- Parameters:
collider-
-
setTextures
Sets texture for pressed and unpressed state of the pressure plate- Parameters:
unpressed- texture for when unpressedpressed- texture for when pressed
-