Class: Game

Stumped. Game

Gather branches and build up your lodge as beavers fight to survive.

new Stumped.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

Array.<Stumped.Beaver> beavers

Every Beaver in the game.

Stumped.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.

number freeBeaversCount

When a Player has less Beavers than this number, then recruiting other Beavers is free.

Object.<string, Stumped.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.

Array.<Stumped.Job> jobs

All the Jobs that Beavers can have in the game.

number lodgeCostConstant

Constant number used to calculate what it costs to spawn a new lodge.

number lodgesToWin

How many lodges must be owned by a Player at once to win the game.

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.

string name

The name of the game.

Array.<Stumped.Player> players

List of all the players in the game.

string session

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

Array.<Stumped.Spawner> spawner

Every Spawner in the game.

number spawnerHarvestConstant

Constant number used to calculate how many branches/food Beavers harvest from Spawners.

Array.<string> spawnerTypes

All the types of Spawners in the game.

Array.<Stumped.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.

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