Beispiel #1
0
        public SandParticle()
        {
            var orange = Color.Orange;
            //делаем вариацию цвета
            var d = (int)(Math.Abs(FastRnd.Next()) * 100);

            Color = Color.FromArgb(orange.R - d, orange.G - d, orange.B);
            //
            Velocity = new PointF(FastRnd.Next() * 2, FastRnd.Next() * 2);
        }
Beispiel #2
0
        public FoamParticle()
        {
            Mass = 0.1f;
            var orange = Color.LightGoldenrodYellow;
            var d      = (int)(Math.Abs(FastRnd.Next()) * 100);

            Color = Color.FromArgb(orange.R - d, orange.G - d, orange.B);
            //
            Velocity = new PointF(FastRnd.Next() * 2, FastRnd.Next() * 2);
        }
 public override void OnCollision(Sandbox sb, Particle other)
 {
     if (other.Mass < Mass)//меняем местами, если столкнулись с более тяжелой частицей
     {
         var loc = other.Location;
         other.Location = Location;
         Location       = loc;
     }
     Velocity = Velocity.Mult(-0);
     Velocity = Velocity.Add(new PointF(FastRnd.Next() * 2, FastRnd.Next() * 1f));
 }
Beispiel #4
0
 public Car()
 {
     MaxSpeed = FastRnd.Gauss(0.05f, 0.03f);
     Path     = new LinkedList <PointF>();
 }
 public WaterParticle()
 {
     Mass     = 0.5f;
     Velocity = new PointF(FastRnd.Next() * 2, FastRnd.Next() * 2);
 }