new Catastrophe.Game()
Initializes a Game with basic logic as provided by the Creer code generator.
Never use this directly. It is for internal Joueur use.
Extends
- BaseGame
Members
-
number catEnergyMult
-
The multiplier for the amount of energy regenerated when resting in a shelter with the cat overlord.
-
Catastrophe.Player currentPlayer
-
The player whose turn it is currently. That player can send commands. Other players cannot.
-
number currentTurn
-
The current turn number, starting at 0 for the first player's turn.
-
Object.<string, Catastrophe.GameObject> gameObjects
-
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.
-
number harvestCooldown
-
The amount of turns it takes for a Tile that was just harvested to grow food again.
-
Array.<Catastrophe.Job> jobs
-
All the Jobs that Units can have in the game.
-
number lowerHarvestAmount
-
The amount that the harvest rate is lowered each season.
-
number mapHeight
-
The number of Tiles in the map along the y (vertical) axis.
-
number mapWidth
-
The number of Tiles in the map along the x (horizontal) axis.
-
number maxTurns
-
The maximum number of turns before the game will automatically end.
-
number monumentCostMult
-
The multiplier for the cost of actions when performing them in range of a monument. Does not effect pickup cost.
-
number monumentMaterials
-
The number of materials in a monument.
-
string name
-
The name of the game.
-
number neutralMaterials
-
The number of materials in a neutral Structure.
-
Array.<Catastrophe.Player> players
-
List of all the players in the game.
-
string session
-
A unique identifier for the game instance that is being played.
-
number shelterMaterials
-
The number of materials in a shelter.
-
number startingFood
-
The amount of food Players start with.
-
number starvingEnergyMult
-
The multiplier for the amount of energy regenerated when resting while starving.
-
Array.<Catastrophe.Structure> structures
-
Every Structure in the game.
-
Array.<Catastrophe.Tile> tiles
-
All the tiles in the map, stored in Row-major order. Use `x + y * mapWidth` to access the correct index.
-
number timeAddedPerTurn
-
The amount of time (in nano-seconds) added after each player performs a turn.
-
number turnsBetweenHarvests
-
After a food tile is harvested, the number of turns before it can be harvested again.
-
number turnsToCreateHuman
-
The number of turns between fresh humans being spawned on the road.
-
number turnsToLowerHarvest
-
The number of turns before the harvest rate is lowered (length of each season basically).
-
Array.<Catastrophe.Unit> units
-
Every Unit in the game.
-
number wallMaterials
-
The number of materials in a wall.
Methods
-
Tile | null getTileAt(x, y)
-
Gets the Tile at a specified (x, y) position
Name Type Description x
number integer between 0 and the mapWidth y
number integer between 0 and the mapHeight Returns: Tile | null
the Tile at (x, y) or null if out of bounds