Class: Game

Saloon. Game

Use cowboys to have a good time and play some music on a Piano, while brawling with enemy Cowboys.

new Saloon.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 bartenderCooldown

How many turns a Bartender will be busy for after throwing a Bottle.

Array.<Saloon.Bottle> bottles

All the beer Bottles currently flying across the saloon in the game.

number brawlerDamage

How much damage is applied to neighboring things bit by the Sharpshooter between turns.

Array.<Saloon.Cowboy> cowboys

Every Cowboy in the game.

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

Array.<Saloon.Furnishing> furnishings

Every furnishing in the game.

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

All the jobs that Cowboys can be called in with.

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 maxCowboysPerJob

The maximum number of Cowboys a Player can bring into the saloon of each specific job.

number maxTurns

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

string name

The name of the game.

Array.<Saloon.Player> players

List of all the players in the game.

number rowdinessToSiesta

When a player's rowdiness reaches or exceeds this number their Cowboys take a collective siesta.

string session

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

number sharpshooterDamage

How much damage is applied to things hit by Sharpshooters when they act.

number siestaLength

How long siestas are for a player's team.

Array.<Saloon.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 turnsDrunk

How many turns a Cowboy will be drunk for if a bottle breaks on it.

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