Because every student should have the opportunity to learn how to code

User Tools

Site Tools


lev4:act_pong_s

Activity : Build Your Own Pong Game

Ninja Instructions | Mentor Notes

Introduction

In this activity you will create a basic pong game.

Duration

15-30 minutes

Instructions

  1. Open up a new program area in Scratch or begin by remixing our Pong Starter program.
  2. If you are creating this program completely on your own:
    • Add a sprite for a ball that will be bouncing around on the screen
    • Add a sprite for the goal position a the end of the maze.
    • To get started, paint a backdrop with a solid colored bar along the bottom of the screen.
    • Put them all together so you have a simple pong game showing.
  3. If you are using our sample starter code, take a look at what we have for these features.
  4. Add one of the the following code samples to the paddle so that it can respond to the user's controls. so that it knows to start the game in it's starting location when the green flag is pressed.

  5. Add the following code to the ball so that the player can move the ball around the maze.


  6. Add the following code to the ball to have it move around the screen when the game starts

  7. Add the following code to the ball to have it bounce off the paddle.

  8. Add the following code to the ball to have it detect that it has missed the paddle and is on the bottom of the screen.

Great. Now you have a basic Pong game. Try some of these modifications.

  • How do you add difficulty to the game by adding speed to the ball every so often? (Hint, you can count bounces or use a timer)
  • How do you add difficulty by changing the size of the paddle every so often?
  • Make a variable to keep score.
  • Can you add in the concept of multiple lives?
  • What would you need to do to modify the code so that the ball looks at where it is on the screen to decide if it is on the bottom rather than looking for color?

The following blocks make great blocks to play around with as part of this game:

Things to think about when you are done

  • What was challenging about designing this game?
  • What feature are you most proud of?

Sharing your project in the studio

The studio for this activity is located at:

Credits

This project is based on materials from the the Creative Computing curriculum by Brennan, Balch, and Chung.

lev4/act_pong_s.txt ยท Last modified: 2015/10/15 11:20 by jbschafer