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 3D character

Now, we are going to create a specialized subclass of Actor (Balder.Core.Runtime.Actor) for the UFO. This is our first intent to generalize many behaviors related to 3D characters. In this case, it is a 3D character composed of just one model (an instance of Mesh).

  1. Stay in the 3DInvadersSilverlight project.
  2. Create a new class—Ufo (a subclass of Actor)—using the following declaration:
    public class Ufo : Actor
    
  3. Add the following lines of code at the beginning (as we are going to use many of Balder's classes and interfaces):
    using Balder.Core;
    using Balder.Core.Geometries;
    using Balder.Core.Math;
    using Balder.Core.Runtime;
    
  4. Add the following protected variables to hold references for the RealTimeGame ...

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