#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 TankAttack
{
	/// <summary>
	/// Custom particle system for creating the fiery part of the explosions.
	/// </summary>
	class TankExplosionParticleSystem : ParticleSystem
	{
		public TankExplosionParticleSystem(Game game, ContentManager content)
			: base(game, content)
		{ }


		protected override void InitializeSettings(ParticleSettings settings)
		{
			settings.TextureName = "explosion";

			settings.MaxParticles = 10000;

			settings.Duration = TimeSpan.FromSeconds(1.5);
			settings.DurationRandomness = 1;

			settings.MinHorizontalVelocity = 1;
			settings.MaxHorizontalVelocity = 1;

			settings.MinVerticalVelocity = 1;
			settings.MaxVerticalVelocity = 1;

			settings.EndVelocity = 0;

			settings.MinColor = Color.DarkGray;
			settings.MaxColor = Color.Gray;

			settings.MinRotateSpeed = -1;
			settings.MaxRotateSpeed = 1;

			settings.MinStartSize = 10;
			settings.MaxStartSize = 20;

			settings.MinEndSize = 100;
			settings.MaxEndSize = 200;

			// Use additive blending.
			settings.SourceBlend = Blend.SourceAlpha;
			settings.DestinationBlend = Blend.One;
		}
	}
}
