O'Reilly logo

3D Game Development with Microsoft Silverlight 3 Beginner's Guide by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action—creating a class to handle audio concurrency

Now, your project manager wants you to add different sound effects associated with different game events. Sometimes, these sounds have to be played concurrently. For example, a thunder can happen at the same time as the player applies an impulse to an UFO.

It is time to create a simple yet useful sound manager class. It must be able to handle many concurrent sound banks:

  1. Stay in the 3DInvadersSilverlight project.
  2. Create a new class—SoundManager.
  3. Add the following lines of code at the beginning of the class definition (as we are going to use the System.Collections.Generic.List class):
    using System.Collections.Generic;
    
  4. Add the following private and static variables:
    // The target for the new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required