DoorReceiver
public class DoorReceiver : GameStructureObject, GameSignalReceivable
A class that represents a door. This is commonly used for exit doors, but can be adapted to use any door.
-
Whether the door is on by default.
Declaration
Swift
var defaultOn: Bool -
The method of how this door will be activated.
Declaration
Swift
var activationMethod: GameSignalMethod -
The list of inputs that activate the door.
Declaration
Swift
var inputs: [GameSignalSender] { get set } -
The base texture name for the door.
Declaration
Swift
var baseTextureName: String -
The player listener for this door.
Declaration
Swift
var playerListener: Player?
-
The activation-based texture for this door.
Declaration
Swift
var activeTexture: SKTexture { get } -
Whether the door is activated.
Declaration
Swift
var active: Bool { get } -
The description for this class.
Declaration
Swift
public override var description: String { get }
-
Declaration
Swift
required init( fromInput inputs: [GameSignalSender], reverseSignal: Bool, baseTexture: String, at location: CGPoint ) -
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)
-
Receive input from a player or event.
Declaration
Swift
func receive(with player: Player?, event: NSEvent?, handler: ((Any?) -> Void)) -
Update the texture for this door.
Declaration
Swift
func update() -
Update the list of inputs and their receivers.
Declaration
Swift
func updateInputs() -
Toggle the physics body for the door.
Note
This method should apply for all doors that are not exits.Declaration
Swift
func togglePhysicsBody()