Exemple #1
0
        private void CreateParticleEmitter(Game game)
        {
            particleEmmiter = new ParticleEmitter();

            IsActive = false;

            particleEmmiter.MaxParticles = 3000;

            particleEmmiter.Duration = TimeSpan.FromSeconds(3);

            particleEmmiter.DurationRandomness = 1;

            particleEmmiter.MinHorizontalVelocity = 0;
            particleEmmiter.MaxHorizontalVelocity = 3;

            particleEmmiter.MinVerticalVelocity = -5;
            particleEmmiter.MaxVerticalVelocity = 5;

            // Set gravity upside down, so the flames will 'fall' upward.
            particleEmmiter.Gravity = new Vector3(0, 5, 0);

            particleEmmiter.MinColor = new Color(255, 255, 255, 100);
            particleEmmiter.MaxColor = new Color(255, 255, 255, 200);
            particleEmmiter.BlendState = BlendState.NonPremultiplied;

            particleEmmiter.MinStartSize = 5;
            particleEmmiter.MaxStartSize = 8;

            particleEmmiter.MinEndSize = 15;
            particleEmmiter.MaxEndSize = 30;

            particleEmmiter.Reset();

            particleEmmiter.LoadContent(game.GraphicsDevice);
            particleEmmiter.LoadParticleEffect(game.Content.Load<Texture2D>("Texture2D/Particle/fire"));
        }
Exemple #2
0
        private void CreateParticleEmitter(Game game)
        {
            particleEmmiter = new ParticleEmitter();

            IsActive = false;

            particleEmmiter.MaxParticles = 600;

            particleEmmiter.Duration = TimeSpan.FromSeconds(10);

            particleEmmiter.MinHorizontalVelocity = 0;
            particleEmmiter.MaxHorizontalVelocity = 5;

            particleEmmiter.MinVerticalVelocity = 3;
            particleEmmiter.MaxVerticalVelocity = 7;

            // Create a wind effect by tilting the gravity vector sideways.
            particleEmmiter.Gravity = new Vector3(7, -2, 0);

            particleEmmiter.EndVelocity = 0.75f;

            particleEmmiter.MinRotateSpeed = -1;
            particleEmmiter.MaxRotateSpeed = 1;

            particleEmmiter.MinStartSize = 2;
            particleEmmiter.MaxStartSize = 4;

            particleEmmiter.MinEndSize = 17;
            particleEmmiter.MaxEndSize = 30;

            particleEmmiter.MinColor = new Color(0, 0, 0, 255);
            particleEmmiter.MaxColor = new Color(55, 55, 55, 255);
            particleEmmiter.BlendState = BlendState.NonPremultiplied;

            particleEmmiter.Reset();

            particleEmmiter.LoadContent(game.GraphicsDevice);
            particleEmmiter.LoadParticleEffect(game.Content.Load<Texture2D>("Texture2D/Particle/smoke"));
        }
Exemple #3
0
        private void CreateParticleEmitter(Game game)
        {
            particleEmmiter = new ParticleEmitter();

            IsActive = false;

            particleEmmiter.MaxParticles = 1200;

            particleEmmiter.Duration = TimeSpan.FromSeconds(2);

            particleEmmiter.MinHorizontalVelocity = 1;
            particleEmmiter.MaxHorizontalVelocity = 4;

            particleEmmiter.MinVerticalVelocity = 0;
            particleEmmiter.MaxVerticalVelocity = 5;

            particleEmmiter.Gravity = new Vector3(0.3f, -10, 0.3f);

            particleEmmiter.EndVelocity = 1;

            particleEmmiter.MinRotateSpeed = -1;
            particleEmmiter.MaxRotateSpeed = 1;

            particleEmmiter.MinStartSize = 1;
            particleEmmiter.MaxStartSize = 3;

            particleEmmiter.MinColor = new Color(255, 255, 255, 255);
            particleEmmiter.MaxColor = new Color(255, 255, 255, 255);
            particleEmmiter.BlendState = BlendState.NonPremultiplied;

            particleEmmiter.MinEndSize = 3;
            particleEmmiter.MaxEndSize = 7;

            particleEmmiter.Reset();

            particleEmmiter.LoadContent(game.GraphicsDevice);
            particleEmmiter.LoadParticleEffect(game.Content.Load<Texture2D>("Texture2D/Particle/water"));
        }