SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

7.05 Flying your helicopter

Let’s use the arrow keys to fly your helicopter.

Let’s start by coding your helicopter to move up when the up arrow is pressed.

helicopter sprite

Test your code and you’ll see that your helicopter’s y position (up/down) changes whenever the up arrow is pressed.

To have your helicopter move more smoothly, you can instead add code to move upwards inside your helicopter’s forever loop.

helicopter sprite

You can also code your helicopter to move to the left when the left arrow is pressed. This time you’ll need to change the helicopter’s x postition by -5.

helicopter sprite

Now code your helicopter to respond to the down and right arrow keys.

×
×

Cart