First we need to load a level. We can do this by clicking the "Select Level" button, then clicking the first level (named "Thrust"), and finally clicking the "Load" button. After the level is loaded, you should see something like the following:
If you hover over the blue circle, you should see a tool tip pop up with more information about the object. It has a type of "target" and an objective of "reach" — this means that you need to navigate your spaceship into that blue circle in order to complete the level.
thrust() function — it is a function that takes a single value, the thrust power, in the range from 0 to 1. We want to accelerate at full power, so the only code we need is
To run this code, we need to open the code editor. There is a button on the left side of the screen that displays and hides the editor. Once it is open, type
thrust(1);. This should look similar to the following:
Now you can close the editor. To install the new code, click the "Install & Restart" button. Then, to run the code, click the "Run" button. You should see your spaceship accelerate into the reach target, like the following:
Congratulations! You have completed the first level. The levels that follow quickly increase in difficulty, and force the player to make use of the other available functions, such as
fire(), etc. Sometimes to complete a level you will simply have to navigate to some target, while other times you may have to destroy enemies or defend targets of your own.
In the future I may write up a tutorial for completing a more complicated level. In the meantime, if you wish to see the completion of a more complicated level in action, copy and paste this code into the editor, then install and run it with the "Obstacle" level loaded. Enjoy!
If you find any bugs or just have questions or comments, you can reach me at email@example.com.