SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

9.02 Moving the football

Let’s code the ball to move across the bottom of the stage.

Open the ‘Beat the Goalie’ Scratch starter project.

Online: open the starter project at beat-the-goalie-on.

In the starter project, you should see a goal backdrop, a football and goalie sprite.

starter projects

Click on your football sprite. Add this code, so that the football moves along the bottom of the screen until the space bar is pressed.

football sprite

Click the green flag to test your project. Your football should bounce along the bottom of the screen until the space bar is pressed.

screenshot

Add this code to your football sprite, so that the football moves towards the goal after the space bar has been pressed.

football sprite

Click the green flag to test your code. This time, press the space bar and your football should move towards the goal.

screenshot

Click the green flag to test your code. What happens if you click the flag a second time? Can you fix the problem?

×
×

Cart