Beispiel #1
0
        private Particle2D SpawnParticle()
        {
            Particle2D particle = new Particle2D(_textures[_randomEx.Next(_textures.Count)])
            {
                LifeTime        = TimeSpan.FromSeconds(_randomEx.Next((int)StartLifeTimeMin.TotalSeconds, (int)StartLifeTimeMax.TotalSeconds)),
                Position        = Position,
                Velocity        = new Vector2(_randomEx.NextFloat(StartVelocityMultiplyMin, StartVelocityMultiplyMax), _randomEx.NextFloat(StartVelocityMultiplyMin, StartVelocityMultiplyMax)),
                Angle           = _randomEx.NextFloat(StartAngleMin, StartAngleMax),
                AngularVelocity = _randomEx.NextFloat(StartAngularVelocityMin, StartAngularVelocityMax),
                Scale           = _randomEx.NextFloat(StartScaleMin, StartScaleMax)
            };

            return(particle);
        }