Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IGameEvents

Hierarchy

  • IGameEvents

Index

Methods

createWorld

  • createWorld(world: World): any
  • Parameters

    Returns any

end

  • Called when the game is ending

    Parameters

    • state: PlayerState

      The state of the player (why the game is ending)

    Returns any

getCameraPosition

  • Called when getting the position to render at. By default, this is the player's location.

    Parameters

    • position: IVector2

      The player's location

    Returns IVector2 | undefined

    The new position to render at, or undefined to use the player's location

getZoomLevel

  • getZoomLevel(): number | undefined
  • Called when setting the zoom level.

    Returns number | undefined

glInitialized

  • glInitialized(): any
  • Returns any

glLostContext

  • glLostContext(): any
  • Returns any

glSetup

  • glSetup(restored: boolean): any
  • Parameters

    • restored: boolean

    Returns any

loadStep

  • loadStep(): any
  • Returns any

pause

  • pause(): any
  • Returns any

play

  • play(): any
  • Returns any

postSaveGame

  • Parameters

    Returns any

preSaveGame

  • Parameters

    Returns any

resume

  • resume(): any
  • Returns any

terrainChange

  • terrainChange(x: number, y: number, z: number, tile: ITile, oldType: TerrainType): any
  • Called when a tile type changes.

    Parameters

    • x: number
    • y: number
    • z: number
    • tile: ITile
    • oldType: TerrainType

    Returns any

tickEnd

  • tickEnd(tickFlag: TickFlag, ticks: number): any
  • Parameters

    Returns any

tickStart

  • tickStart(tickFlag: TickFlag, ticks: number): any
  • Parameters

    Returns any

tileUpdate

  • tileUpdate(tile: ITile, x: number, y: number, z: number, tileUpdateType: TileUpdateType): void
  • Called when a tile is updated (tile type changed, doodad created on it, etc)

    Parameters

    • tile: ITile

      The tile that was updated

    • x: number

      The x position of the updated tile

    • y: number

      The y position of the updated tile

    • z: number

      The z position of the updated tile

    • tileUpdateType: TileUpdateType

      The tile update type

    Returns void

Generated using TypeDoc