Options
All
  • Public
  • Public/Protected
  • All
Menu

Module logic/game

Index

Functions

runGame

  • runGame(canvasName: string, fpsCounterName: string, gameHUD: GameHUD, navigator?: any, canvas?: any, window?: any): void
  • Runs the Game and entry point of the game logic

    Parameters

    • canvasName: string

      Id of the Canvas HTMLElement

    • fpsCounterName: string

      Id of the FPS Counter HTMLElement

    • gameHUD: GameHUD

      Heads-up display GameHUD to relay info to the user.

    • Optional navigator: any

      Mocked navigator for unit testing.

    • Optional canvas: any

      Mocked canvas for unit testing.

    • Optional window: any

      Mocked window for unit testing.

    Returns void

setGameInstance

  • setGameInstance(testGame: Game): void
  • Only for testing and mocking purposes. This is only used if ran from Node (Jasmin)

    Parameters

    • testGame: Game

      Game instance to be overwritten.

    Returns void

startGameLoop

  • startGameLoop(): void
  • Sets up the GameLoop. If you were looking for the core gameloop, well, this is it.

    Here we set what happens in a frame (or rather, game tick).

    Returns void

Generated using TypeDoc