예제 #1
0
        public void Conflict(Repellent ball)
        {
            Color aux;

            aux        = this.color;
            this.color = ball.color;
            ball.color = aux;
        }
예제 #2
0
        private void initRepellent()
        {
            for (int i = 0; i < NrRepellent; i++)
            {
                int      raza  = rnd.Next(1, 10);
                Movement move  = new Movement(rnd.Next(canvas.width), rnd.Next(canvas.height), rnd.Next(10), rnd.Next(10), rnd.Next(10));
                Color    color = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));

                Repellent ball = new Repellent(raza, move, color);

                balls.Add(ball);
            }
        }
예제 #3
0
 public void Conflict(Repellent ball)
 {
     this.move.dx *= -1;
     this.move.dy *= -1;
     ball.color    = Ball.ColorMix(ball, this);
 }