AstroBot

Documentation

Quick Overview

The AstroBot field is 500 by 500 pixels, with rocks coming from either the top, bottom, left, or right sides offscreen. Sooting rocks will give you more points the bigger the rock is, along as breaking into smaller pieces.

Code is read one line per frame, top to botttom. Each line will be a command followed by a number if nessacary, seperating them with spaces. Any tab lines or text that are not commands are ignored.

Ship Commands

thrust

Propells the ship by a bit in the direction it's pointing. the more thrust is called, the faster the ship goes. The ship will naturally slow back down to a stop.

left

right

Turns the ship left or right by 10 degrees. Degrees start facing up, and go clockwise.
The ship starts at zero degrees (facing up).

stop

Stops the ship to a halt.

shoot

Shoots a bullet to destroy rocks. Note that you have a few frames before you can shoot again.

Logic Commands

forever

A loop that executes code inside of it forever until the player crashes. This is essentially your core game loop. Code before forever will execute normally but however won't be called again.

forever
thrust
end

Thrusts forward forever.

loop 10

A loop that executes code inside of it an amount of times specified by the number.

loop 9
left
end

Turns left by 90 degrees.

ifRock 45

A conditional that checks if there is a rock a specified amount of degrees from the ship.
However, the ship can only see within a distance of 180 pixels. Positive numbers check to the right, while negitive numbers check to the left.

So for example, ifRock 180 will check a rock behind of the player.

forever
right
ifRock 0
shoot
end
end

Spins around shooting any rocks the ship sees in front.

end

Used to close loops and conditionals.