Class: Checker

Checkers. Checker

A checker on the game board.

new Checkers.Checker()

Initializes a Checker with basic logic as provided by the Creer code generator. Never use this directly. It is for internal Joueur use.

Extends

Members

string gameObjectName

Inherited From:
Checkers.GameObject#gameObjectName
String representing the top level Class that this game object is an instance of. Used for reflection to create new instances on clients, but exposed for convenience should AIs want this data.

string id

Inherited From:
Checkers.GameObject#id
A unique id for each instance of a GameObject or a sub class. Used for client and server communication. Should never change value after being set.

boolean kinged

If the checker has been kinged and can move backwards.

Array.<string> logs

Inherited From:
Checkers.GameObject#logs
Any strings logged will be stored here. Intended for debugging.
The player that controls this Checker.

number x

The x coordinate of the checker.

number y

The y coordinate of the checker.

Methods

boolean isMine()

Returns if the checker is owned by your player or not.
Returns: boolean
True if it is yours, false if it is not yours.

log(message)

Inherited From:
Checkers.GameObject#log
Adds a message to this GameObject's logs. Intended for your own debugging purposes, as strings stored here are saved in the gamelog.
Name Type Description
message string A string to add to this GameObject's log. Intended for debugging.

Checkers.Checker move(x, y)

Moves the checker from its current location to the given (x, y).
Name Type Description
x number The x coordinate to move to.
y number The y coordinate to move to.
Returns: Checkers.Checker
Returns the same checker that moved if the move was successful. Otherwise null.

string toString()

Inherited From:
BaseGameObject#toString
toString override for easier debugging
Returns: string
readable string in the format `GameObjectName #id`