| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #region File Description
- //-----------------------------------------------------------------------------
- // ExplosionParticleSystem.cs
- //
- // Microsoft XNA Community Game Platform
- // Copyright (C) Microsoft Corporation. All rights reserved.
- //-----------------------------------------------------------------------------
- #endregion
- #region Using Statements
- using System;
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Content;
- using Microsoft.Xna.Framework.Graphics;
- #endregion
- namespace Particle3DSample
- {
- /// <summary>
- /// Custom particle system for creating the fiery part of the explosions.
- /// </summary>
- class ExplosionParticleSystem : ParticleSystem
- {
- public ExplosionParticleSystem(Game game, ContentManager content)
- : base(game, content)
- { }
- protected override void InitializeSettings(ParticleSettings settings)
- {
- settings.TextureName = "explosion";
- settings.MaxParticles = 100;
- settings.Duration = TimeSpan.FromSeconds(2);
- settings.DurationRandomness = 1;
- settings.MinHorizontalVelocity = 20;
- settings.MaxHorizontalVelocity = 30;
- settings.MinVerticalVelocity = -20;
- settings.MaxVerticalVelocity = 20;
- settings.EndVelocity = 0;
- settings.MinColor = Color.DarkGray;
- settings.MaxColor = Color.Gray;
- settings.MinRotateSpeed = -1;
- settings.MaxRotateSpeed = 1;
- settings.MinStartSize = 7;
- settings.MaxStartSize = 7;
- settings.MinEndSize = 70;
- settings.MaxEndSize = 140;
- // Use additive blending.
- settings.BlendState = BlendState.Additive;
- }
- }
- }
|