Controlling an actor with keystrokes
In this task, we will use the arrow keys to control a robot’s movement. We will add code associated with each of the four arrow keys. We will use a property to avoid the robot to perform two movements at the same time.
We will use an existing project that has an instance of
gina as one of two characters from the Looking Glass Characters gallery.
- Open the project saved in the Reacting to keyboard events recipe.
- Click on Edit Code, at the lower-right corner of the big scene preview. Alice will show a smaller preview of the scene and will display the Code Editor on a panel located at the right-hand side of the main window.
- Click on the class: MyScene drop-down list and the list of classes that are part ...