GameScene

class GameScene : SKScene

The base class for a given level.

Requires

A tile map node called “Tile Map Node”. Automapping should be disabled, and the tileset should be “Costumemaster Default”.

Requires

A camera node called “Camera”.

Requires

Level configuration data in the scene’s user data. See also: LevelDataConfiguration.

STORED PROPERTIES

SCENE LOADING

  • Set up the game scene, parse the tilemapm and start playing music.

    Declaration

    Swift

    override func sceneDidLoad()

LIFE CYCLE UPDATES

  • Run scene-related lifecycle updates.

    Declaration

    Swift

    override func update(_ currentTime: TimeInterval)
  • Run any post-update logic and check input states.

    Declaration

    Swift

    override func didFinishUpdate()
  • Prepare the scene for destruction and save the scene name.

    Declaration

    Swift

    override func willMove(from view: SKView)
  • Call the scene with a given file name.

    Declaration

    Swift

    func callScene(name: String?)

    Parameters

    name

    The file name of the scene to call.

STATE MANAGEMENT

  • Check the state of the inputs.

    Declaration

    Swift

    func checkInputStates(_ event: NSEvent)
  • Check the wall states and update their physics bodies.

    Declaration

    Swift

    func checkWallStates(with costume: PlayerCostumeType?)

    Parameters

    costume

    The costume to run the checks against.

  • Check the state of the doors in the level.

    Declaration

    Swift

    func checkDoorStates()
  • Drop or pickup items near the player.

    Declaration

    Swift

    func grabItems()
  • Get the pause menu screen and load it.

    Declaration

    Swift

    func getPauseScene()
  • Make state updates that inform the player that they have “died”.

    Declaration

    Swift

    func kill()

INPUT TRIGGER EVENTS

  • Listen to keyboard events and run the game logic for key events.

    Declaration

    Swift

    public override func keyDown(with event: NSEvent)
  • Listen for keyboard events and halt the player if the movement keys were released.

    Declaration

    Swift

    public override func keyUp(with event: NSEvent)