Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Stage<SomeGame> Abstract

A single stage of the game. Use this with StagedGame.

Type Parameters

Hierarchy

  • Stage

Index

Constructors

  • new Stage<SomeGame>(game: SomeGame): Stage<SomeGame>
  • Type Parameters

    Parameters

    • game: SomeGame

    Returns Stage<SomeGame>

Properties

game: SomeGame
inited: boolean

Methods

  • enter(): void
  • Called when transiting to this stage or when pushing on the stack. Tempory stages are entered only once.

    Returns void

  • init(): void
  • Called to prepare the stage for playing. Call super.init() when overriding.

    Returns void

  • leave(): void
  • Called when transiting away from this stage or when poping from the stack When called on a tempory stage, it means that this stage will be lost and garbage collected.

    Returns void

  • pause(): void
  • Called when temporarily leaving this stage by pushing another stage.

    Returns void

  • render(): any
  • Called on each frame to draw the stage.

    Returns any

  • resume(): void
  • Called when comming back to this stage after poping another stage

    Returns void

  • update(dt: number): any
  • Called on each frame to update the game.

    Parameters

    • dt: number

    Returns any

Generated using TypeDoc