# Pong Teachers' Guide

#### Teacher Notes

Students should be encouraged to extend the app to different types of animation and game. Suggestions for further exploration are mentioned below. A variety of games can be made with the basics from Pong; please see the similar apps below.

#### Suggestions for further exploration

• Change the colors or image of the ball, as well as the corresponding sound.
• Add level/stage labels to organize the game.
• Use the orientation sensor to move the paddle.

#### Similar apps to try

• Mole Mash: Similar to Pong, MoleMash is a game in which a mole pops up at random positions on a phone's screen, and the player scores points by hitting the mole with his/her finger before it jumps away.
• Flip a Coin: Flip a Coin introduces the concepts of abstraction and randomization of numbers. It can be extended to many different topics by using the template.

#### Example Curriculum

• Mole Mash chapter in the Six-week High School curriculum
• Game chapter in David Wolber's site.

#### Solution for Challenge 1: Changing the Speed and the Size of the Ball

Step 1: Drag the if component from the Control drawer and place it under the last block in the Ball1CollideWith block, then drag an equal ("=") block from the Math drawer and drop it at the "test" section of the if block.

Drag the remainder block from the Math drawer and place it at the first section of the equal block (#1).

Open the My Definition drawer and drag out the global score block and drop it at the top socket of the remainder block (#2)

Drag the number block from the Math drawer and place it at the bottom socket of the remainder block (#3), highlight the number and change it to 10.

Drag the number block from the Math drawer and place it after the equal sign, highlight the number and change it to "0." The block should look like this:

Step 3: Under the Ball1 drawer, drag the Ball1.SpeedTo block and place it at the "then-do" section of the if block. Under the Math drawer, drag the addition ("+") block and place it after the Ball1.SpeedTo block. Under the Ball1 drawer, drag the Ball1.Speed block and place it at the first socket of the plus block. Open the Math drawer, drag a number block and place it at the second socket of the plus block, then change the number to "5". Your block should look like this now:

Step 4: In the same way, drag the Ball1.RadiusTo block and place it under the block you just made in the previous step. Under the Math drawer, drag the subtraction ("-") block and place it after the Ball1.RadiusTo block. Under the Ball1 drawer, drag the Ball1.Radius block and place it at the first socket of the plus block. Open the Math drawer, drag a number block and place it at the second socket of the plus block, then change the number to "2". Your block should look like this now:

Done! Try it out with your phone!

#### Solution for Challenge 2: Playing A Sound for Different Actions

Step 1: Download the audio files from the bottom of the Pong instruction page or the Media Library.

Step 2: In the Designer, upload all the files into the Media pane.

Step 3: Under the Palette pane, open the Media palette, drag the Sound component to the Viewer.

Step 4: Open the Blocks Editor. Under the My Blocks palette, open the Sound1 drawer and drag the Set.Sound1.Source block and drop it under the SetBall1.Heading block in the Ball1.Collidewith event handler.

Step 5: Drag a text block from the Text palette and place it after the Sound1.Source block. Highlight the text property of the block and type the audio file name. (here, type "note.wav"). You need to type the exact name of the audio file, and it is case sensitive. You can copy and past the file name from the Media palette.

Step 6: Under the My Blocks palette, open the Sound1 drawer and drag the Sound1.Play block and drop it at the bottom of the Ball1.CollideWith event handler.

Step 7: Drag the Sound1.Play block from the Sound1 drawer and drop it below the Set.Ball1Radius block. Change the text property to Tada.mp3.

Step 8: For the buzzer and noink sound, the blocks should be placed in the Ball1.EdgeReached event handler. Place the block for the buzzer sound (#1) under the "then-do" section of the ifelse block, and place the block for the noink sound (#2) at the "else-do" section.

Done! Try the app now and see if you can hear the corresponding sound for each action!

`Return to module 1 here.`