GamePressurePlate
class GamePressurePlate : GameSignalSender
An input that uses pressure sensitivity to activate.
-
Initialize a pressure plate.
Declaration
Swift
public init(at position: CGPoint)
Parameters
position
The position of the plate in the matrix.
-
Required initializer for this class. Will result in a fatal error if you initialize the object this way.
Declaration
Swift
required init?(coder aDecoder: NSCoder)
-
Whether the input should turn on/off based on player or object intervention.
Declaration
Swift
public override func shouldActivateOnIntervention(with player: Player?, objects: [SKSpriteNode?]) -> Bool
Parameters
player
The player to listen to for intervention.
objects
The objects to listen to for intervention.
Return Value
Whether the input should activate given the intervention criteria.
-
Determine if the player is in range and play the pressure plate activation sound.
Declaration
Swift
public override func onActivate(with event: NSEvent?, player: Player?)
-
Determine if the player is out of range and play the pressure plate deactivation sound.
Declaration
Swift
public override func onDeactivate(with event: NSEvent?, player: Player?)