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—specializing a game superclass

Now, we can specialize RealTimeGame instead of using subclasses of Game. This requires a small change to the code. We have to override the UpdateWithTime method instead of overriding the Update method. Besides, we have to remove the line base.Update(); used in the Update method. These changes will allow us to animate 3D characters taking into account the elapsed time.

  1. Stay in the 3DInvadersSilverlight project.
  2. Open InvadersGame.cs.
  3. Replace the declaration for the InvadersGame class with this one. (Now, it will be a subclass of RealTimeGame.):
    public class InvadersGame : RealTimeGame
    
  4. Replace the declaration of the Update method with the following. (Now, we override the UpdateWithTime method instead.): ...

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