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 subclass for a complex asteroid belt

Now, we are going to create a specialized subclass of Actor (Balder.Core.Runtime.Actor) to load, create an update a fluid with waves. This class will enable us to encapsulate an independent asteroid belt and add it to the game. In this case, it is a 3D character composed of many models (many instances of Mesh).

  1. Stay in the 3DInvadersSilverlight project.
  2. Create a new class, FluidWithWaves (a subclass of Actor) using the following declaration:
    public class FluidWithWaves : Actor
    
  3. Replace the default using declarations with the following lines of code (we are going to use many classes and interfaces from Balder, Farseer Physics Engine and lists):
    using System.Windows; using System.Windows.Controls; ...

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