Space AI Documentation

Table of Contents

Object Reference

GameObject

The root game object.

Ammo extends GameObject

A GameObject with a type of 'ammo'. Adds a new Weapon to the player, or increases an existing Weapon's ammo if the player already has a weapon of the same type.

Asteroid extends GameObject

A GameObject with a type of 'asteroid'. If the player comes into contact with an Asteroid, they lose.

Bullet extends GameObject

A GameObject with a type of 'bullet'. If an object with a health property comes into contact with a Bullet, the object's health decreases.

HealthPack extends GameObject

A GameObject that with a type of 'health'. When the player touches a HealthPack, their health increases.

Target extends GameObject

A GameObject with a type of 'target'. Each Target has an objective which may be necessary for the player to win if the win property is true, or may cause the player to lose if the lose property is set to true.

EnemyShip extends Target

A flying saucer that chases after and shoots at the player's ship when it gets too close. EnemyShip has a type of 'ship' and an objective of 'destroy'.

EnemyTarget extends Target

A Target with an objective of 'destroy'. EnemyTargets are immobile and do not shoot back.

FriendlyTarget extends Target

A Target with an objective of 'defend'. FriendlyTargets are immobile and cannot shoot.

ReachTarget extends Target

A Target with an objective of 'reach'. The player must land inside a ReachTarget in order to complete it.

SpaceMine extends Target

A Target with a type of 'mine' and an objective of 'evade'.

Rectangle

A shape with x, y, width, and height components.

Vector

A vector with x, y, and angular components.

Weapon

A weapon that can be wielded by the player or another ship. Fires Bullet objects.