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 specialized sprite management class

We now have the User Controls defined. We need to move many sprites based on these User Controls. Now, we are going to create a generalized superclass to manage the most common operations related to a User Control working as a sprite.

  1. Stay in the SilverlightInvaders2DVector project
  2. Create a new abstract class—UpdateableUIElement
  3. Add the following public property to determine whether the user interface element is alive or not:
    public bool isAlive { set; get; }
    
  4. Add the following public abstract method to encapsulate updates based on the elapsed time:
    public abstract void Update(TimeSpan elapsedTime);
    
  5. Create a new abstract class—SpriteWrapper (a subclass of UpdateableUIElement) —using the ...

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