GameSignalReceivable

protocol GameSignalReceivable : GameTileSpriteNode

A base protocol that defines an object that receives signals from inputs.

STORED PROPERTIES

  • Whether the device is on by default.

    Declaration

    Swift

    var defaultOn: Bool { get set }
  • The means of how this receiver will react to input signals.

    Declaration

    Swift

    var activationMethod: GameSignalMethod { get set }
  • The inputs that connect to this receiver.

    Declaration

    Swift

    var inputs: [GameSignalSender] { get set }
  • The base texture name for this receiver.

    Declaration

    Swift

    var baseTextureName: String { get set }

COMPUTED PROPERTIES

  • The texture for this receiver, accounting for the signal state.

    Declaration

    Swift

    var activeTexture: SKTexture { get }
  • Whether the receiver is active.

    Declaration

    Swift

    var active: Bool { get }
  • The position of the output in context with the level world.

    Note

    Use self.position to determine the position of the actual note.

    Declaration

    Swift

    @available(*, deprecated, renamed: "worldPosition")
    var levelPosition: CGPoint { get }

METHODS

  • Initialize a game receiver.

    Declaration

    Swift

    init(fromInput inputs: [GameSignalSender], reverseSignal: Bool, baseTexture: String, at location: CGPoint)

    Parameters

    inputs

    The inputs that the receiver will listen to for signal updates.

    reverseSignal

    Whether to reverse the signal.

    baseTexture

    The name of the base texture to use when creating texture states.

    location

    The location of the output in context with the level.

  • Update the properties of the receiver’s sprite.

    Important

    Do not store logic-related function such as activity status inside this method. This method is used specifically to make visual changes on every frame.

    Declaration

    Swift

    func update()
  • Update the status of this receiver based on new inputs.

    Declaration

    Swift

    func updateInputs()