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—shaking many illustrations at the same time

  1. Stay in the SilverlightMonster project.
  2. Expand MainPage.xaml in the Solution Explorer and open MainPage.xaml.cs.
  3. Add the following private variable in the public partial class MainPage : UserControl to hold a list of Ghost instances:
    private List<Ghost> _ghosts;
    
  4. Add the following lines of code after the line InitializeComponent(); in the constructor. (We must create the list and add the Ghost instances created through the XAML code.)
    // Create the new list _ghosts = new List<Ghost>(); // Add each Ghost instance previously created through XAML code _ghosts.Add(ghost); _ghosts.Add(ghost2); _ghosts.Add(ghost3); _ghosts.Add(ghost4); _ghosts.Add(ghost5); _ghosts.Add(ghost6); _ghosts.Add(ghost7); ...

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