Running your game
Run, Restart, Stop
| Button | Key | What it does |
|---|---|---|
| Run | F5 | saves everything, then starts your game |
| Restart | Ctrl+R (Cmd+R) | starts it again from the top, without the splash |
| Stop | Shift+F5 | stops it |
On your computer the game opens in its own CrashPlayer window, beside the IDE. In a browser it runs in the panel at the top right of the page. The dot at the right end of the toolbar says how it’s doing: running, paused, stopped, or ended.
When something goes wrong
If your game stops with an error, I tell you about it myself, in a box with my picture on it. It says whether it was a PARSE ERROR (something I couldn’t read) or a RUNTIME ERROR (something that went wrong while the game was running), what happened, and the line and column. Details has more, when there’s more to say.
Crash-tan’s Tip: An error on your computer stops the game right where it happened, with everything still as it was. Look in the Debug tab and you can see every variable at that moment. Finding bugs is all about it.
The Console
The Console tab at the bottom shows what your game prints as text, and it has a line along the bottom to type into. What you type there depends on the game:
- While it’s running, what you type runs in the game. Type
SET SPRITE 0 !! x(100)and the sprite moves, there and then. - While it’s stopped at a breakpoint, it works out what you type right
there: type
scoreand you see the score at that moment, or change it withscore = 1000. - When nothing’s running, it waits for you to run the game.
Up and Down bring back what you typed before.
Push
Push (Ctrl+Enter, or Cmd+Enter) sends code into the game while it runs, without starting it again. Select some lines and push, and just those run in the game. Push with nothing selected and the whole file goes.
So you can change a behavior, push it, and watch the sprites change what they’re doing, while you’re still playing. Hold the pointer over Push to see what it does in your game’s language: in a language that can’t do it yet, it’s greyed out.
Files the game saves (in a browser)
A game that saves (high scores, a saved game, a level from its own editor) writes into your project. On your computer that’s straight into the folder. In a browser, the IDE asks you first. After a run, Files the game saved lists each one, and for each you choose:
- Accept: it goes into the project, like a file you made yourself.
- Keep temporary: the game can still read it next time, but it isn’t part of the project. They’re listed under the files as Saved by the game, to accept or discard later.
- Discard: it’s thrown away.
That way, a test run that saved a high score of 3 doesn’t end up in the game you share.
A database (.db, .sqlite) is the exception: it comes straight into the
project, without asking, since it’s where a game keeps what lasts. Look
inside it, and take out the test scores, with the
database editor.
The Terminal (on your computer)
The Terminal tab is a terminal in your project’s folder, for anything
you’d type at a command line, like crashplayer --validate ..
Ctrl+** shows it, and **Ctrl+Shift+ (or +) opens another.