This tutorial applies to making a noise in Pong when a ball hits a paddle.
This same idea can be used for other situations or in other projects.
Make sure you have a sound clip inside the resources folder for the project. For Pong, one is already included.
At the top of Pong.java where the variables are declares (like "private Sprite wall;"), add a new line that says "
private Sound mySound = new Sound( "resources\\DingLower.wav" );
"
Find the handleCollisions method. Inside it should be a line that say "handleCollision(singlePaddle, timePassed);". Make a new line after it that says "mySound.play();"
Run Pong and make sure to hit the Sound On button so the sound plays!