Introduction video

FREE Scratch Tennis Activity Pupil Pack

ūüõ† What will you need?

The Scratch website. It is free to use and works on all devices.

What will you learn?
Program a tennis style game in Scratch using:
– Keyboard inputs for control and loops for the ball.
– Conditions for interaction and game-play, including sensing.
– Random variables for unpredictability, including operators for direction.  
– Use data variables for scoring.

1. Build your court
Watch the video to learn how to use the built-in paint tools to create a tennis court backdrop (stage), including adding coloured target area sprites.

Tennis sprites tutorial

2. Players and ball
Watch the video to learn how to draw two player sprites and add a tennis ball sprite.

‚ÄčIf you would like to¬†simplify your game you could create line sprites to make¬†more of a Pong-style game. Watch the second the video tutorial for this.

3. Control your players
Watch the video to learn how to add keyboard inputs to player sprites to move them up and down on the court.

If you are on a touch screen device such as an iPad then watch the second video to learn how to program touch screen inputs.

4. Hitting the ball
Program loops and movements to make your ball sprite move. Also add conditions, operators and random variables so that it bounces off the sprites and the walls in unpredictable directions.

5. Points System
Watch the video to learn how to use data variables to add a scoring system. 
Add a sensing code block within a condition that when the ball hits the lines sprites behind each player, the score of the opposite player will go up. 

Could you make it better?
Could you add an input that when each sprite is clicked or tapped, it resets the score to zero? (Use the screenshot to help you)

What about when a point is scored, the ball goes back to the middle and pauses (wait code block) before starting again?