Class: Body

Stardash. Body

A celestial body located within the game.

new Stardash.Body()

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

Extends

Members

number amount

The amount of material the object has, or energy if it is a planet.

string bodyType

The type of celestial body it is. Either 'planet', 'asteroid', or 'sun'.

string gameObjectName

Inherited From:
Stardash.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:
Stardash.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.

Array.<string> logs

Inherited From:
Stardash.GameObject#logs
Any strings logged will be stored here. Intended for debugging.

string materialType

The type of material the celestial body has. Either 'none', 'genarium', 'rarium', 'legendarium', or 'mythicite'.
The Player that owns and can control this Body.

number radius

The radius of the circle that this body takes up.

number x

The x value this celestial body is on.

number y

The y value this celestial body is on.

Methods

log(message)

Inherited From:
Stardash.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.

number nextX(num)

The x value of this body a number of turns from now. (0-how many you want).
Name Type Description
num number The number of turns in the future you wish to check.
Returns: number
The x position of the body the input number of turns in the future.

number nextY(num)

The x value of this body a number of turns from now. (0-how many you want).
Name Type Description
num number The number of turns in the future you wish to check.
Returns: number
The x position of the body the input number of turns in the future.

boolean spawn(x, y, title)

Spawn a unit on some value of this celestial body.
Name Type Description
x number The x value of the spawned unit.
y number The y value of the spawned unit.
title string The job title of the unit being spawned.
Returns: boolean
True if successfully taken, false otherwise.

string toString()

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