How Add Piezo Buzz to Pong Sketch I am junior high teacher teaching students how to program using Arduino. I know the basics of programing but the students wanted to program a game which is a little above my skill set. I am using the following sketch (http://www.itopen.it/arduino-pong-with-8x8-led-matrix-and-max7219/) to introduce them to programing games. Thanks to this site I understand most of the code. However I would like to add a line of code that will make a piezo buzzer buzz every time the "ball" hits the pad. I think the code should look something like the code bellow, but I am not sure if it is correct or where I would put it.

#define buz 8 // number of pin buzzer connected to 
     if (HIT_CENTER || HIT_RIGHT || HIT_LEFT) {
        digitalWrite(buz, HIGH);
        delay(100);
        digiralWrite(buz, LOW);
        }


Any help would be appreciated.
The condition HIT_CENTER || HIT_RIGHT || HIT_LEFT will always be true.  (All three of those HIT_ values are non-zero constants.)

Instead, you need to test if getHit() is non-zero.  (To see this, search the sketch for occurrences of HIT_RIGHT or HIT_LEFT.)  

The sketch sets up an event timer (via ball_timer = timer.every(BALL_DELAY, moveBall); in setup()) so that ball position will update every 200 ms.  The loop() sequence is: Use timer.update() to service timer events.  Use setPad() to read the paddle position.  Use drawGame() to update the game picture. Somehow use checkLoose() to see if game is over.  Use delay(GAME_DELAY) to wait 10 ms.

Given that structure of loop(), throwing in a 100 ms delay to wait for a buzzer would mess up the game play.  You could turn on the buzzer and set up a timer event for turning it off, each time the ball hits the paddle.

More straightforwardly, since a 10 ms beep is likely to be adequately long, you could test for a hit just before delay(GAME_DELAY), and always turn the buzzer off just after that delay.  In other words, before the delay say:
if (getHit()) digitalWrite(buz, HIGH); and after the delay say digitalWrite(buz, LOW);.

This supposes that writing HIGH to buz turns on the buzzer and that writing LOW turns it off.