GameObject
The GameObject class is a subclass of the Entity class and is used for objects in the world that have a meaningful lifespan; essentially ships, stations and terrain objects. The GameObject class has all the properties and function of the Entity class, as well as properties and functions common to all types derived from GameObject.
Inherits
Properties
Name | Type | Access | Description |
---|---|---|---|
odf | String | R | The lowercase ODF filename of the GameObject |
hull | Number | RW | The hull strength of the GameObject in the range 0 to 1 |
hullValue | Number | RW | The actual hull hit points of the GameObject |
maxHull | Number | RW | The maximum hit points the hull has |
specialEnergy | Number | RW | Special energy in range 0 to 1 |
maxSpecialEnergy | Number | RW | Maximum special energy points |
specialEnergyValue | Number | RW | Current special energy in actual points |
label | String | R | The label identifier of the GameObject |
invincible | Boolean | RW | If true, the GameObject cannot be destroyed |
velocity | Vector | RW | The direction and magnitude of the GameObject's movement |
forceOntoMap | Boolean | RW | If true, the GameObject cannot leave the boundaries of the map |
underAttack | Boolean | R | True if the GameObject was attacked recently |
cloaked | Boolean | R | True if the GameObject is currently cloaked |
destroyed | Boolean | R | If true, the GameObject has been destroyed |
canCloak | Boolean | R | True if the GameObject is capable of cloaking |
player | Player | RW | The player that owns this GameObject |
perceivedTeam | Player | RW | The player that appears to own this GameObject |
aiControlled | Boolean | R | True if this GameObject is controlled by an AI |
class | GameObjectClass | R | The type definition of the GameObject |
Functions and Enumerations
- Instance Functions
Functions that are used with a GameObject instance.
- cloak( )
Cloak the GameObject; will only work if there is a cloaking device available.
- decloak( )
Decloak the GameObject; will only work if there is a cloaking device available
- immediateCloak( )
Cloak the GameObject, skipping the cloaking cycle; will only work if there is a cloaking device installed.
- giveOrder( order, position )
Give a command to a GameObject with a Vector parameter
- giveOrder( order, entity )
Give a command to the GameObject, with an Entity parameter
- giveOrder( order, odf, position )
Give a command to the GameObject with an ODF and position parameter
- giveOrder( order, number )
Give a command to this GameObject using a number as the parameter
- giveOrder( order )
Give an order with no parameter
- addWeapon( odf )
Add an extra weapon to this GameObject
- cloak( )
- Enumerations
Enumerations that are part of the GameObject class.
- Order
Commands for GameObjects
- Order