Now we will practice the concept of events in our first star wars project!
In this project you will see a “droid” in the center of the screen. This droid is your main character. And in this excercise we will learn to program the droid to move around when you enter the up, down, left and right keys on your keyboard.
Click the link: https://studio.code.org/projects/starwarsblocks/new
Click “Rename” to name the project however you want. You can come back and change it any time. If you don’t know what to name it, just put something like “Star wars [today’s date]”

Don’t forget to click save after renaming it.

Now that we have the project let’s go ahead and set up the controls for the droid.
In order to setup the controls for the droid we will need the “When x arrow” and the “Move droid” block.
The “When x arrow” block is an Event block, it is green color and can be found in the “Events” folder.

The “Move droid” block is an Actions block, it’s turqoise color and can be found in the “Actions” folder.

Drag 1x “When up” arrow block and place it anywhere on the editor. You will notice that the Event block does not have a socket at the top, that’s why it can be placed anywhere. Basically it just means that the Event block does not run with the main program, it only runs when the specified key is pressed.

Drag a “Move droid” block and place in the socket of the “When up arrow” block. And enter 10 pixels to move the droid up 10 pixels.

Experiment with the parameters of the blocks.
