Air Hockey Tutorial 7

This tutorial will teach you how to use the SwinGameSDK to develop a simple air hockey game. At the end of this tutorial you should be able to use Visual Basic 6 to implement your game which makes use of Vectors, Sprites and SoundEffects.

How To Get Sound Effects For Your Game
Here is a site that I have found very useful for getting sound effects. [link] The only bad thing is its all in Japanese. To get to the sounds go to that page, then click on the ""FREE" MATERIALS" link. Now go to ""FREE" SOUNDS". All the sounds are here, but if you cant read Japanese like me its a bit hard to work out what they each sound like. To fix this you can download all of them at once. To do this click on the "zip" link. This will take you to a were you can download all the sounds easily. Now you need to download, se_pack01.exe, se_pack_06.exe and se_pacl07.exe. Run those 3 files and you will have 1377 sound effects.

New Resources
At this point in the creation of the game new images were made for it, they can be found [[Media: Air Hockey Tutorial 7 New Resources.zip | here]] along with the sounds. As there the new images are different we will need to change a few things. One of the things that will need changing is the constants. Theses will now be.

Next we have to change where the score is displayed. This will be changed to.

Loading The Sounds Effects
We now need to load the sounds that we are going to use.

Playing The Sounds
The first sound effect we will add is "Bat hit side", this will get checked in "MoveBat" and we will check if it has hit the side just after we call "MoveSprite".

Now we will add "Ball hit bat" this will go in "MoveBall" right after we have the "VectorCollision" if the bat and ball hit.

The next sound to add is "Ball in goal" the will also be called in "MoveBall" after we check if the ball has gone in the goal. This will go in two places.

The last sound is "Ball hit side" and this will be called in "KeepBallOnTable", this will be called after we check if the ball has hit one of the side.

List Of Tutorials

 * 1) Introduction
 * 2) Table
 * 3) Ball
 * 4) Player
 * 5) AI
 * 6) Scoring
 * 7) Sound
 * 8) Menu
 * 9) Finishing