Time for action – building a sound effects manager

  1. Download the 0669_05_AUDIOPACK.zip file from the book's website and extract the files to a temporary folder.
  2. Right-click on the content project in Solution Explorer and add a new folder called Sounds.
  3. Add the .WAV files from the audio pack temporary folder to your new Sounds folder in the content project.
  4. Add a new class to the Asteroid Belt Assault project called "SoundManager".
  5. Add using directives to the top of the SoundManager class file:
    using System.Diagnostics;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Audio;
    using Microsoft.Xna.Framework.Content;
  6. Modify the declaration of the SoundManager class by adding public static before the declaration:
    public static class SoundManager ...

Get XNA 4.0 Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.