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—adding an asteroid belt background to the game

Now, we are going to add another physics simulator with a different gravitational force to control the fluid model as an actor, with a predefined behavior.

  1. Stay in the 3DInvadersSilverlight project.
  2. Open InvadersGame.cs.
  3. Add the following private variable in the public class InvadersGame : RealTimeGame, to hold another PhysicsSimulator (FarseerGames.FarseerPhysics.PhysicsSimulator) instance:
    private PhysicsSimulator _fluidPhysicsSimulator;
    
  4. Add the following private variable to hold the new FluidWithWaves instance:
    private FluidWithWaves _fluidWithWaves;
    
  5. Add the following private method to initialize the fluids physics simulator, specifying a specific desired gravitational force as a 2D ...

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