0% found this document useful (0 votes)
182 views

Project 2 Pong Planning Worksheet

Uploaded by

42misarishah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
182 views

Project 2 Pong Planning Worksheet

Uploaded by

42misarishah
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Pong program preparation planning

We're ready to write our first game! Part of programming is breaking down a problem into smaller pieces that you can solve separately. You then
combine these smaller pieces into larger components until you have the whole program put together.
For the Pong game, use this planning worksheet to help design your code BEFORE you start writing. Read over all the requirements in the left column.
Take a few minutes to think before filling out the rest of the worksheet. The first row is an example.

Game What's going What owns What triggers the What could be Pseudocode
component on? the logic? change? tricky?
Players can control Paddle moves up or Paddle sprite Press up or down arrow When paddle gets to the Left paddle
variable: left speed
paddles with required down Press w or s keys top or bottom it can't move
keys anymore if sprite is hitting top edge of canvas OR
hitting bottom edge of canvas then
reverse paddle movement

When up arrow is pressed


If paddle is moving down
stop paddle
else
change direction to up

Ball begins play at Ball will point in a The ball To begin the game press making sure the ball does When space is clicked
middle of field at start random direction and space key not leave to work area sprite ball wil point in a random
of game and after each and move in that direction and glide there until
point direction hits another sprite

Ball bounces correctly When the ball The ball It triggers when the ball Making sure the where the

Adapted from GHHS Intro CS 2016


1
off upper and lower touches the sprite touches the paddle ball hits the paddle If paddle1 is touched by sprite
edges of paddles paddle1 it will glide ball, sprite ball will glide the in a
in opposite direction random direction
in any direction

Ball increases speed When the ball The paddle it triggers when ball It would be hard to make a If sprite ball touches paddle1
each time it bounces touches paddle1, touches paddle variable for speed variable speed will increase the
off a paddle variable speed will balls speed by 2
increase by 2

Score a point for the If the ball sprite Bottom of the when ball touches the It would be hard to draw out When sprite ball touches sprite
opponent when the ball touches the bottom screen sprite bottom of screen sprite the sprite bottom of the screen pause
touches the left or right of the game sprite game and show game over
edge screen will say game
over.

Game ends when one When player2 Variable player2 when ball touches the It would be tricky to make it When ball touches bottom of
player reaches five variable reaches 5 bottoms of screen sprite so the game will end when screen sprite give variable
points show player 2 wins player reaches 5 points player to a point

Adapted from GHHS Intro CS 2016


2
Winning player is When player2 Variable player2 when ball touches the It would be tricky to make it
shown when the game variable reaches 5 bottoms of screen sprite so the game will end when When ball touches bottom of
ends show player 2 wins player reaches 5 points screen sprite give variable
player to a point

Players can begin a when green flag is green flag When green flag is When green flag is clicked When green flag is clicked
new game clicked new game clicked reset and starting reset and starting restart the game
will start

Adapted from GHHS Intro CS 2016


3

You might also like