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 remaining lives gauge

Now, we are going to create a new UserControl to display the remaining lives in a gauge. We will use the previously created ScoreGauge as a baseline to create this new gauge, making many changes. We will use our well-known blue alien as an icon to specify the remaining lives.

  1. Open the project 3DInvadersSilverlight in Visual Studio or Visual C#.
  2. Repeat the previously explained steps to create a new gauge based on ScoreGauge.xaml. Instead of using BonusGauge as the new name, use LifeGauge.
  3. Open LifeGauge.xaml.cs (the C# code for LifeGauge.xaml) and replace the text ScoreGauge with LifeGauge in the first lines that define the class and the constructor, as shown in the following:
    public partial class LifeGauge ...

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