Options
All
  • Public
  • Public/Protected
  • All
Menu

Maintains the state of the game. Here is an example flow:

const engine = new GameEngine(gameData)
engine.setLevel(0)
engine.pressRight()
engine.tick()
engine.tick()
engine.pressUp()
engine.tick()
engine.pressUndo()
engine.tick()

Hierarchy

  • GameEngine

Index

Constructors

constructor

Methods

canUndo

  • canUndo(): boolean

getCurrentLevel

getCurrentLevelCells

  • getCurrentLevelCells(): Cell[][]

getCurrentLevelNum

  • getCurrentLevelNum(): number

getGameData

getSpriteSize

  • getSpriteSize(): object
  • Returns object

    • spriteHeight: number
    • spriteWidth: number

hasAgain

  • hasAgain(): boolean

loadSnapshotFromJSON

on

press

pressAction

  • pressAction(): void

pressDown

  • pressDown(): void

pressLeft

  • pressLeft(): void

pressRestart

  • pressRestart(): void

pressRight

  • pressRight(): void

pressUndo

  • pressUndo(): void

pressUp

  • pressUp(): void

restoreFromMessageLevel

  • restoreFromMessageLevel(): void

saveSnapshotToJSON

setLevel

  • setLevel(levelNum: number): void
  • Parameters

    • levelNum: number

    Returns void

setMessageLevel

  • setMessageLevel(sprites: Array<Array<Set<GameSprite>>>): void

tick

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc