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.
Weapon weapon
The Weapon for the user to pick up.
Asteroid extends GameObject
A GameObject with a type
of 'asteroid'
. If the player comes into contact with an Asteroid, they lose.
Number radius
The maximum radius of the Asteroid.
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.
Number damage
The amount of damage the Bullet does to an object with health.
String weapon
The name of the weapon that fired this Bullet.
String owner
The owner of the Bullet, either 'player' or 'enemy'.
HealthPack extends GameObject
A GameObject that with a type
of 'health'
. When the player touches a HealthPack, their health increases.
Number health
The amount by which the player's health will be increased.
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.
Number radius
String objective
The objective the player needs to complete with this target in order to win the level.
Boolean win
If true, completing this target is necessary for the player to win.
Boolean lose
If true, completing this target will cause the player to lose.
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'
.
Number health
Weapon weapon
Number chaseRange
The range at which the ship will chase after the player.
Number shootRange
The range at which the ship will shoot at the player.
Number hoverRange
The range at which the ship will "hover" and stop trying to get closer to the player.
EnemyTarget extends Target
A Target with an objective
of 'destroy'
. EnemyTargets are immobile and do not shoot back.
Number health
FriendlyTarget extends Target
A Target with an objective
of 'defend'
. FriendlyTargets are immobile and cannot shoot.
Number health
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'
.
Number damage
The amount that the mine decreases an object's health when it explodes.
Number range
The range at which a SpaceMine will be attracted to the player.
Rectangle
A shape with x, y, width, and height components.
Number x
Number y
Number width
Number height
Vector
A vector with x, y, and angular components.
Number x
Number y
Number angular
The angular component, in radians.
Weapon
A weapon that can be wielded by the player or another ship. Fires Bullet objects.
String name
The name used to identify the type of weapon.
Number damage
The amount of damage done with each Bullet from this Weapon.
Number ammo
The amount of Bullets the Weapon has left, or null if the Weapon has unlimited ammo.
Number range
The distance a Bullet from this Weapon can travel in a given reference frame.
Number speed
The speed at which Bullets travel when fired from this Weapon.
Number cooldown
The number of frames necessary between shots of this Weapon.
Number cooldownTimer
The number of frames left before this Weapon can be fired again.