Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Game

Convert as many humans to as you can to survive in this post-apocalyptic wasteland.

Hierarchy

  • BaseGame
    • Game

Implements

  • IBaseGame

Index

Properties

catEnergyMult

catEnergyMult: number

The multiplier for the amount of energy regenerated when resting in a shelter with the cat overlord.

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

harvestCooldown

harvestCooldown: number

The amount of turns it takes for a Tile that was just harvested to grow food again.

jobs

jobs: Job[]

All the Jobs that Units can have in the game.

lowerHarvestAmount

lowerHarvestAmount: number

The amount that the harvest rate is lowered each season.

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.

maxTurns

maxTurns: number

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

monumentCostMult

monumentCostMult: number

The multiplier for the cost of actions when performing them in range of a monument. Does not effect pickup cost.

monumentMaterials

monumentMaterials: number

The number of materials in a monument.

neutralMaterials

neutralMaterials: number

The number of materials in a neutral Structure.

players

players: Player[]

List of all the players in the game.

session

session: string

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

shelterMaterials

shelterMaterials: number

The number of materials in a shelter.

startingFood

startingFood: number

The amount of food Players start with.

starvingEnergyMult

starvingEnergyMult: number

The multiplier for the amount of energy regenerated when resting while starving.

structures

structures: Structure[]

Every Structure in the game.

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.

turnsBetweenHarvests

turnsBetweenHarvests: number

After a food tile is harvested, the number of turns before it can be harvested again.

turnsToCreateHuman

turnsToCreateHuman: number

The number of turns between fresh humans being spawned on the road.

turnsToLowerHarvest

turnsToLowerHarvest: number

The number of turns before the harvest rate is lowered (length of each season basically).

units

units: Unit[]

Every Unit in the game.

wallMaterials

wallMaterials: number

The number of materials in a wall.

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