MainMenuScene

class MainMenuScene : SKScene, GKGameCenterControllerDelegate

The scene class for the main menu.

  • The label node for the word “The”.

    Declaration

    Swift

    var labelSmall: SKLabelNode?
  • The label node for the title.

    Declaration

    Swift

    var labelTitle: SKLabelNode?
  • The sprite node with the character.

    Declaration

    Swift

    var character: SKSpriteNode?
  • The label node for the “Start Game” button.

    Declaration

    Swift

    var startButton: SKLabelNode?
  • The label node for the “Resume Game” button.

    Declaration

    Swift

    var resumeButton: SKLabelNode?
  • The label node for the “Options” button.

    Declaration

    Swift

    var optionsButton: SKLabelNode?
  • The label node for the “Quit Game” button.

    Declaration

    Swift

    var quitButton: SKLabelNode?
  • The Game Center sprite node for the Game Center dashboard.

    Note

    This should only be used in older versions of macOS. In macOS 11.0, the GKAccessPoint is used instead.

    Important

    This field has been deprecated and will be removed in a future release. Please use GKAccessPoint instead.

    Declaration

    Swift

    @available(*, deprecated, message: "Game Center button has been fully replaced with GKAccessPoint.")
    var gameCenterButton: SKSpriteNode?
  • The sprite node for the Watch Your Step DLC.

    Declaration

    Swift

    var watchYourStepButton: SKSpriteNode?
  • The sprite node for the ‘Try The Costumemaster: Reloaded’ button.

    Declaration

    Swift

    var reloadedButton: SKSpriteNode?
  • The level of interactivity from this scene.

    Declaration

    Swift

    var interactiveLevel: Int
  • Whether to set character attributes for this scene.

    Declaration

    Swift

    var setCharacterAttributes: Bool
  • Instantiate the Game Center access point.

    In macOS 11.0, this will use the native access point and put it in the bottom left. For older versions, a sprite node will be used to present a Game Center view.

    Important

    This method has been deprecated and will be replaced by instantiateAccessPoint.

    See also

    instantiateAccessPoint

    Declaration

    Swift

    @available(*, deprecated, renamed: "instantiateAccessPoint")
    func setUpGameCenterProperties()
  • Set up the Game Center button for the main menu.

    Declaration

    Swift

    override func didMove(to view: SKView)
  • Set up the scene and play the main menu music.

    Declaration

    Swift

    override func sceneDidLoad()
  • Dismiss the Game Center view controller when done.

    Declaration

    Swift

    func gameCenterViewControllerDidFinish(_ gameCenterViewController: GKGameCenterViewController)
  • Listen for mouse events and trigger the appropriate menu action.

    Declaration

    Swift

    override func mouseDown(with event: NSEvent)
  • Listen for mouse events and update the character attributes.

    Declaration

    Swift

    override func rightMouseDown(with event: NSEvent)
  • Run post-update logic to refresh scene properties.

    Declaration

    Swift

    override func didFinishUpdate()