Presentation is loading. Please wait.

Presentation is loading. Please wait.

Year 11 DTG 2012 - Intermediate Using MIT Scratch for Programming and Control Exercise 2 Controlling movement with the keyboard Year 11 DTG 2012 - Intermediate.

Similar presentations


Presentation on theme: "Year 11 DTG 2012 - Intermediate Using MIT Scratch for Programming and Control Exercise 2 Controlling movement with the keyboard Year 11 DTG 2012 - Intermediate."— Presentation transcript:

1 Year 11 DTG 2012 - Intermediate
Using MIT Scratch for Programming and Control Exercise 2 Controlling movement with the keyboard Year 11 DTG Intermediate

2 What you will learn In this exercise we will learn:
how to control the movement of the sprite with the keyboard arrows using x and y co-ordinates We can combine this with the previous exercise to make the sprite walk around the screen

3 Keyboard control It is possible to control your sprite using the keyboard arrow keys. There is a small pointer next to the Sprite symbol at the top of the screen which can be set to any angle thereby determining the natural direction of movement of the sprite. In this exercise we want the Sprite to move exactly up and down vertically or side to side horizontally so we will use the change x by and change y by instructions to order to ensure that the Sprite moves exactly horizontally or vertically

4 Keyboard control Before completing this exercise dump your existing script into the left had side of the screen (this will delete it)

5 Keyboard control Now copy the main part of the script then edit the sub script for each movement of the mouse determined by each of the respective four arrow keys

6 Keyboard control Drop the three new copied sets of instructions inside the forever instruction (not inside the existing If condition instruction) Click the green flag button. It should now be possible to drive your cat sprite around the screen using the up, down, left and right arrow keys

7 Keyboard control

8 Cat walking with keyboard control
Looking back over the previous exercises it should be possible to make a script combining what you have already learned that allows the Cat sprite to walk around the screen.

9 Save your work Save this exercise with the file name catwalk2


Download ppt "Year 11 DTG 2012 - Intermediate Using MIT Scratch for Programming and Control Exercise 2 Controlling movement with the keyboard Year 11 DTG 2012 - Intermediate."

Similar presentations


Ads by Google