new Newtonian.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
-
Newtonian.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, Newtonian.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 internCap
-
The maximum number of interns a player can have.
-
Array.<Newtonian.Job> jobs
-
A list of all jobs. The first element is intern, second is physicists, and third is manager.
-
Array.<Newtonian.Machine> machines
-
Every Machine in the game.
-
number managerCap
-
The maximum number of managers a player can have.
-
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 materialSpawn
-
The number of materials that spawn per spawn cycle.
-
number maxTurns
-
The maximum number of turns before the game will automatically end.
-
string name
-
The name of the game.
-
number physicistCap
-
The maximum number of physicists a player can have.
-
Array.<Newtonian.Player> players
-
List of all the players in the game.
-
number refinedValue
-
The amount of victory points added when a refined ore is consumed by the generator.
-
number regenerateRate
-
The percent of max HP regained when a unit end their turn on a tile owned by their player.
-
string session
-
A unique identifier for the game instance that is being played.
-
number spawnTime
-
The amount of turns it takes a unit to spawn.
-
number stunTime
-
The amount of turns a unit cannot do anything when stunned.
-
Array.<Newtonian.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 timeImmune
-
The number turns a unit is immune to being stunned.
-
Array.<Newtonian.Unit> units
-
Every Unit in the game.
-
number victoryAmount
-
The amount of combined heat and pressure that you need to win.
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