GameAchievementTrigger

class GameAchievementTrigger : GameSignalSender

A class representation of a Game Center achievement trigger. Game Center triggers will trigger earning an achievement upon player contact.

  • The achievement to earn when passing through the trigger.

    Declaration

    Swift

    let gameAchievement: GameAchievement?
  • Whether the trigger had been activated.

    Declaration

    Swift

    var didActivate: Bool
  • The active texture for the trigger.

    Declaration

    Swift

    override var activeTexture: SKTexture { get }
  • Initialize a Game Center trigger.

    Declaration

    Swift

    init(with achievement: GameAchievement?, at location: CGPoint)

    Parameters

    achievement

    The game achievement to earn when passing through.

    location

    The level position of the trigger.

  • 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.

  • Activate an achievement when entering the field.

    Declaration

    Swift

    public override func onActivate(with event: NSEvent?, player: Player?)
  • Declaration

    Swift

    public override func onDeactivate(with event: NSEvent?, player: Player?)