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 and controlling a meteor rain

Now, we are going to add another physics simulator with a different gravitational force to control dozens of meteors and to create the illusion of a meteors rain.

  1. Stay in the 3DInvadersSilverlight project,.
  2. Open InvadersGame.cs for the C# code.
  3. Add the following private variable in the public class InvadersGame : RealTimeGame, to hold another PhysicsSimulator (FarseerGames.FarseerPhysics.PhysicsSimulator) instance:
    private PhysicsSimulator _meteorsPhysicsSimulator;
    
  4. Add the following lines of code at the beginning of the class definition (as we are going to use the System.Collections.Generic.List class):
    using System.Collections.Generic;
    
  5. Add the following private variables to hold the list of meteors, ...

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