コード例 #1
0
        public Particle Create(ref Particle particle, Vector2 position, float direction)
        {
            particle.Type = this;
            particle.Active = true;
            particle.Position = position;
            if (Source == null)
                particle.Size = (int)Calc.Random.Range(Size, SizeRange);
            else
                particle.Size = Calc.Random.Range(Size, SizeRange);
            particle.Color = Color;
            particle.Speed = Calc.AngleToVector(direction - DirectionRange / 2 + Calc.Random.NextFloat() * DirectionRange, Calc.Random.Range(Speed, SpeedRange));
            particle.Life = Calc.Random.Range(Life, LifeRange);
            particle.ColorSwitch = ColorSwitch;
            if (RandomRotate)
                particle.Rotation = Calc.Random.NextAngle();
            else if (Rotated)
                particle.Rotation = direction;

            if (ScaleOut)
                particle.SizeChange = -(particle.Size / (particle.Life * 2f));
            else
                particle.SizeChange = 0;

            return particle;
        }
コード例 #2
0
ファイル: ParticleType.cs プロジェクト: saint11/oldskull
        public Particle Create(Vector2 position, float direction)
        {
            Particle particle = new Particle();
            particle.Type = this;
            particle.Active = true;
            particle.Position = position;
            particle.Size = Calc.Random.Range(Size, SizeRange);
            particle.Color = Color;
            particle.Speed = Calc.AngleToVector(direction - DirectionRange / 2 + Calc.Random.NextFloat() * DirectionRange, Calc.Random.Range(Speed, SpeedRange));
            particle.Life = Calc.Random.Range(Life, LifeRange);
            particle.ColorSwitch = ColorSwitch;

            return particle;
        }
コード例 #3
0
 public Particle Create(ref Particle particle, Vector2 position)
 {
     return Create(ref particle, position, Direction);
 }