Exemplo n.º 1
0
            public static void Recycle(Particle deadParticle, Texture2D particleTexture, Vector2 position, Constants.ViewLayer layer, Vector2 velocity, Vector2 acceleration, double lifeSpan, bool shouldShrink)
            {
                deadParticle.Texture = particleTexture;
                deadParticle.Position = position;
                deadParticle.Layer = layer;
                deadParticle.Velocity = velocity;
                deadParticle.Acceleration = acceleration;

                deadParticle.ClearEffects ();

                deadParticle.DisappearEffect.Reset (lifeSpan);
                deadParticle.StartEffect (deadParticle.DisappearEffect);

                if (shouldShrink) {
                    deadParticle.ScaleEffect.Reset (1f, 0f, lifeSpan);
                    deadParticle.StartEffect (deadParticle.ScaleEffect);
                }

                deadParticle.Visible = true;
            }