Space AI is a game for programmers. You control a spaceship by writing JavaScript code in order to complete a specific task. Each level is a challenge with its own objectives, which may include navigating your ship to a set of coordinates, eliminating enemy ships, and evading obstacles like space mines and asteroids, among other things. This documentation contains a list of keyboard shortcuts you can use in the game, a few code examples, a full function reference that describes the functions you can use to control the ship, and a full object reference that describes the types of game objects on which the functions might operate.
To start playing, you should first choose a level – either click "Select Level" or hit the "s" key and the Level Selector window will pop up. Use the "n" and "p" keys to highlight the next and previous levels, respectively, or click one with your mouse. Then hit enter or click the "load" button to load the selected level. If the level has some help text, it will be displayed in a dialog after it has been loaded. As you complete levels, this will be indicated by a green checkmark on the level's thumbnail.
To start writing code, either click the arrow on the left or hit the "i" key to slide out the coding window. Any JavaScript you write in this window will be executed once per frame in the game. To change the editor theme, you can go to View -> Editor Themes. Once you have written some code, to see it in action it you need to click the "Install & Restart", then click the "Run" button. This will install your code and start it executing, respectively. To save code you have written, go to File -> Save, or hit "Ctrl+s". Saved code will persist across browser sessions unless you clear local storage.
To debug your code, log diagnostic information to the console. You can view the console by clicking the arrow on the bottom of the screen or by hitting the "c" key. For more information, take a look at the logging functions.