3. Move with Arrow keys

Right-click on your main character object and select 'Open editor'.

The editor allows you to write different methods - actions that the class can perform.

The act() method will repeat whenever the Run button is pressed.

1. Open the Code Editor

2. Copy the Code CAREFULLY

You need to use an if statement to check if a certain key (like the right arrow key) is being pressed down.

An if statement must be contained in standard brackets. After each if statement, the proceeding code must be typed within curly brackets - see the image on the left.

Tip - If the brackets are on the same line then use the standard brackets ( and )

      If the brackets are on different lines then use curly brackets { and }

3. Compile (Save) the Code

Click the Compile button at the top of the code editor.

Then you can go back to the main window and click Run.

© CSNewbs 2020