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 TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.void
setPlayerOnPlate
(ColliderComponent collider) void
setTextures
(String unpressed, String pressed) Allow external configuration of textures if you add a pressed texture laterMethods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
PressurePlateComponent
public PressurePlateComponent()
-
-
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. -
setPlayerOnPlate
-
setTextures
Allow external configuration of textures if you add a pressed texture later
-