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 new game superclass to generalize time management capabilities

So far, our Silverlight game does not handle the elapsed time between each rendered frame. We need this information in order to create animations that consider time as a variable.

We are going to create a new abstract superclass to add time management capabilities to the basic Game (Balder.Core.Game) class provided by Balder:

  1. Stay in the 3DInvadersSilverlight project.
  2. Create a new class—RealTimeGame (a subclass of Game)—using the following declaration:
    public abstract class RealTimeGame : Game
    
  3. Add the following line of code at the beginning (as we are inheriting from Balder's Game class):
    using Balder.Core;
    
  4. Add the following private variables and one property ...

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