Getting ready to program Pong in XNA

For the past several weeks, my students have learned C# and started to learn XNA by reviewing the tutorial that Microsoft MVP Bill Reiss put together on his site.

Today, we reviewed how to put sound into the game.  The XNA Creators Club has a good video on this topic. I would highly recommend using the Sound.cs file that Bill uses in his tutorial for you to create your own sounds using XACT.

You just need to change the namespace to the project you are working on and then initialize the sound under the Initialize() method and update the sound in the Update(GameTime gameTime)  method.

Finally, add your sound in your game play:

if (bounced == true)
           {
               Sound.Play("boing");
           }

My students have all kinds of sounds now in their sprite collision.

Next, we'll add sound to a 2d game that uses keyboard commands for movement. The gameplay is pretty basic but the concepts are important for students to learn. After this we'll start to take a look at the pong game.

The students have stuck with it and they are starting to learn XNA.

Print | posted on Monday, March 03, 2008 12:58 PM

Comments on this post

# re: Getting ready to program Pong in XNA

Requesting Gravatar...
Thanks! I am thinking about going into Computer Science at UVSC soon to be UVU. I like your blog. Keep supplying the good info.
Left by xenoalien on Jun 06, 2008 6:23 PM

Your comment:

 (will show your gravatar)
 
Please add 5 and 8 and type the answer here: