Game¶
-
class
games.newtonian.game.
Game
¶ Bases:
joueur.base_game.BaseGame
The class representing the Game in the Newtonian game.
Combine elements and be the first scientists to create fusion.
-
property
current_player
¶ The player whose turn it is currently. That player can send commands. Other players cannot.
-
property
current_turn
¶ The current turn number, starting at 0 for the first player’s turn.
- Type
int
-
property
game_objects
¶ 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
dict[str, games.newtonian.game_object.GameObject]
-
get_game_object
(id: str) → Optional[joueur.base_game_object.BaseGameObject]¶ gets the game object with the given id, or None
- Returns
BaseGameObject in the game with the given id, or None if not found
-
get_tile_at
(x: int, y: int) → Optional[games.newtonian.tile.Tile]¶ Gets the Tile at a specified (x, y) position.
- Parameters
x (int) – An integer between 0 and the map_width.
y (int) – An integer between 0 and the map_height.
- Returns
The Tile at (x, y) or None if out of bounds.
- Return type
games.newtonian.tile.Tile or None
-
property
intern_cap
¶ The maximum number of interns a player can have.
- Type
int
-
property
jobs
¶ A list of all jobs. The first element is intern, second is physicists, and third is manager.
- Type
list[games.newtonian.job.Job]
-
property
machines
¶ Every Machine in the game.
- Type
-
property
manager_cap
¶ The maximum number of managers a player can have.
- Type
int
-
property
map_height
¶ The number of Tiles in the map along the y (vertical) axis.
- Type
int
-
property
map_width
¶ The number of Tiles in the map along the x (horizontal) axis.
- Type
int
-
property
material_spawn
¶ The number of materials that spawn per spawn cycle.
- Type
int
-
property
max_turns
¶ The maximum number of turns before the game will automatically end.
- Type
int
-
property
physicist_cap
¶ The maximum number of physicists a player can have.
- Type
int
-
property
players
¶ List of all the players in the game.
- Type
-
property
refined_value
¶ The amount of victory points added when a refined ore is consumed by the generator.
- Type
int
-
property
regenerate_rate
¶ The percent of max HP regained when a unit end their turn on a tile owned by their player.
- Type
float
-
property
session
¶ A unique identifier for the game instance that is being played.
- Type
str
-
property
spawn_time
¶ The amount of turns it takes a unit to spawn.
- Type
int
-
property
stun_time
¶ The amount of turns a unit cannot do anything when stunned.
- Type
int
-
property
tiles
¶ All the tiles in the map, stored in Row-major order. Use x + y * mapWidth to access the correct index.
- Type
-
property
time_added_per_turn
¶ The amount of time (in nano-seconds) added after each player performs a turn.
- Type
int
-
property
time_immune
¶ The number turns a unit is immune to being stunned.
- Type
int
-
property
units
¶ Every Unit in the game.
- Type
-
property
victory_amount
¶ The amount of combined heat and pressure that you need to win.
- Type
int
-
property