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 fuel gauge

Now, we are going to create a new UserControl to display a fuel gauge. We will use the previously created ScoreGauge as a baseline to create this new gauge, making many changes.

  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 FuelGauge.
  3. Open FuelGauge.xaml.cs and replace the text ScoreGauge with FuelGauge in the first lines that define the class and the constructor, as shown in the following lines:
    public partial class FuelGauge : UserControl
    {
    public FuelGauge()
    
  4. Delete the SetScore method.
  5. Add the following public method to change the fuel level shown in ...

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