Example #1
0
 protected override void LoadContent()
 {
     viewMatrix = Matrix.CreateLookAt(new Vector3(0, 0, -200), new Vector3(0, 0, 0), new Vector3(0, 1, 0));
     projectionMatrix = Matrix.CreateOrthographic(GraphicsDevice.Viewport.Width / 5, GraphicsDevice.Viewport.Height / 5, -5000, 5000);
     explosionParticles = new ExplosionParticleSystem(this.Game, Shorewood.Content);
     projectileTrailParticles = new ProjectileTrailParticleSystem(this.Game, Shorewood.Content);
     explosionSmokeParticles = new ExplosionSmokeParticleSystem(this.Game, Shorewood.Content);
     projectileTrailParticles.DrawOrder = 300;
     explosionParticles.DrawOrder = 400;
     explosionSmokeParticles.DrawOrder = 100;
     explosionParticles.Initialize();
     projectileTrailParticles.Initialize();
     explosionSmokeParticles.Initialize();
     projectileTrailParticles.SelfLoad();
     explosionParticles.SelfLoad();
     explosionSmokeParticles.SelfLoad();
     explosionParticles.SetCamera(viewMatrix, projectionMatrix);
     projectileTrailParticles.SetCamera(viewMatrix, projectionMatrix);
     explosionSmokeParticles.SetCamera(viewMatrix, projectionMatrix);
     base.LoadContent();
 }
        /// <summary>
        /// Handles input for quitting the game and cycling
        /// through the different particle effects.
        /// </summary>
        void HandleInput()
        {
            lastKeyboardState = currentKeyboardState;
            lastGamePadState = currentGamePadState;

            currentKeyboardState = Keyboard.GetState();
            currentGamePadState = GamePad.GetState(PlayerIndex.One);

            // Check for exit.
            if (currentKeyboardState.IsKeyDown(Keys.Escape) ||
                currentGamePadState.Buttons.Back == ButtonState.Pressed)
            {
                Exit();
            }

            /* Check for particle effect reload */
            if (currentKeyboardState.IsKeyUp(Keys.H) && lastKeyboardState.IsKeyDown(Keys.H))
            {
                /* Hacky Reload Incoming! */
                lock (effectLock)
                {
                    //we'll just do everything that we do when making a particle effect up //
                    smokePlumeParticles = new GenericParticleSystem(this, Content);
                    smokePlumeParticles.Initialize("Test.xml");
                    smokePlumeParticles.LoadContent();
                }
            }
        }