| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #region File Description
- //-----------------------------------------------------------------------------
- // ExplosionSmokeParticleSystem.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 smokey part of the explosions.
- /// </summary>
- class ExplosionSmokeParticleSystem : ParticleSystem
- {
- public ExplosionSmokeParticleSystem(Game game, ContentManager content)
- : base(game, content)
- { }
- protected override void InitializeSettings(ParticleSettings settings)
- {
- settings.TextureName = "smoke";
- settings.MaxParticles = 200;
- settings.Duration = TimeSpan.FromSeconds(4);
- settings.MinHorizontalVelocity = 0;
- settings.MaxHorizontalVelocity = 50;
- settings.MinVerticalVelocity = -10;
- settings.MaxVerticalVelocity = 50;
- settings.Gravity = new Vector3(0, -20, 0);
- settings.EndVelocity = 0;
- settings.MinColor = Color.LightGray;
- settings.MaxColor = Color.White;
- settings.MinRotateSpeed = -2;
- settings.MaxRotateSpeed = 2;
- settings.MinStartSize = 7;
- settings.MaxStartSize = 7;
- settings.MinEndSize = 70;
- settings.MaxEndSize = 140;
- }
- }
- }
|