Пример #1
0
 public void swallow(RepellentBall ball)
 {
     //Console.WriteLine("Reg vs. Rep");
     ball.color         = BallUtils.combineColors(ball, this);
     this.direction.dx *= -1;
     this.direction.dy *= -1;
 }
Пример #2
0
        private void initRepellentBalls()
        {
            for (int i = 0; i < repellentBallsCount; i++)
            {
                int       radius    = rnd.Next(1, 10);
                Position  position  = new Position(rnd.Next(canvas.width), rnd.Next(canvas.height));
                Color     color     = Color.FromArgb(rnd.Next(255), rnd.Next(255), rnd.Next(255));
                Direction direction = new Direction(rnd.Next(1, 5), rnd.Next(1, 5), rnd.Next(1, 10));

                RepellentBall ball = new RepellentBall(radius, position, color, direction);

                balls.Add(ball);
            }
        }
Пример #3
0
 public void swallow(RepellentBall ball)
 {
     ball.radius = ball.radius / 2;
 }
Пример #4
0
 public void swallow(RepellentBall ball)
 {
     ball.color = BallUtils.combineColors(ball, this);
     this.color = BallUtils.combineColors(this, ball);
 }