Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Game

Combine elements and be the first scientists to create fusion.

Hierarchy

  • BaseGame
    • Game

Implements

  • IBaseGame

Index

Properties

currentPlayer

currentPlayer: Player

The player whose turn it is currently. That player can send commands. Other players cannot.

currentTurn

currentTurn: number

The current turn number, starting at 0 for the first player's turn.

gameObjects

gameObjects: object

A mapping of every game object's ID to the actual game object. Primarily used by the server and client to easily refer to the game objects via ID.

Type declaration

internCap

internCap: number

The maximum number of interns a player can have.

jobs

jobs: Job[]

A list of all jobs. The first element is intern, second is physicists, and third is manager.

machines

machines: Machine[]

Every Machine in the game.

managerCap

managerCap: number

The maximum number of managers a player can have.

mapHeight

mapHeight: number

The number of Tiles in the map along the y (vertical) axis.

mapWidth

mapWidth: number

The number of Tiles in the map along the x (horizontal) axis.

materialSpawn

materialSpawn: number

The number of materials that spawn per spawn cycle.

maxTurns

maxTurns: number

The maximum number of turns before the game will automatically end.

physicistCap

physicistCap: number

The maximum number of physicists a player can have.

players

players: Player[]

List of all the players in the game.

refinedValue

refinedValue: number

The amount of victory points added when a refined ore is consumed by the generator.

regenerateRate

regenerateRate: number

The percent of max HP regained when a unit end their turn on a tile owned by their player.

session

session: string

A unique identifier for the game instance that is being played.

spawnTime

spawnTime: number

The amount of turns it takes a unit to spawn.

stunTime

stunTime: number

The amount of turns a unit cannot do anything when stunned.

tiles

tiles: Tile[]

All the tiles in the map, stored in Row-major order. Use x + y * mapWidth to access the correct index.

timeAddedPerTurn

timeAddedPerTurn: number

The amount of time (in nano-seconds) added after each player performs a turn.

timeImmune

timeImmune: number

The number turns a unit is immune to being stunned.

units

units: Unit[]

Every Unit in the game.

victoryAmount

victoryAmount: number

The amount of combined heat and pressure that you need to win.

Methods

getTileAt

  • getTileAt(x: number, y: number): Tile | undefined
  • Gets the Tile at a specified (x, y) position

    Parameters

    • x: number

      an integer between 0 and the mapWidth

    • y: number

      an integer between 0 and the mapHeight

    Returns Tile | undefined

    the Tile at (x, y) or null if out of bounds

Generated using TypeDoc