Writing and running your code

In Pytch, you describe what you want the Sprites in your project to do by writing Python code.

You write and edit your Python program in the top-left panel. Unlike Scratch, where changes take effect straight away, in Python there is the idea of starting your program. (TODO: Settle on a good word for this. “Launch”?)

To start your program, click the green flag. If there are errors in your program which mean it can’t start, a description of the problem will appear in the ‘Errors’ tab of the information pane. If there are no errors, the “green flag” event happens, which your Sprites can respond to if they need to, for example, move to their starting position.

It is a good idea to save your project’s code often, with the Save button above the stage. It is highlighted when there are unsaved changes in your program.

TODO: Fill in structure of below.

  • The code editor is what Pytch has instead of Scratch’s scripts area

  • Python uses indentation as part of what your code means; the editor will help you with this

  • The code is part of your project; you have to SAVE it to avoid losing work; this happens every time you green-flag as well

  • See also Running your project