public void swallow(RepellentBall ball) { //Console.WriteLine("Reg vs. Rep"); ball.color = BallUtils.combineColors(ball, this); this.direction.dx *= -1; this.direction.dy *= -1; }
public void swallow(RegularBall ball) { ball.isDone = true; Console.WriteLine("Terminated " + ball.ballType + " Ball [ " + ball.id + "]"); this.color = BallUtils.combineColors(this, ball); this.radius += ball.radius; }
public void swallow(MonsterBall ball) { //Console.WriteLine("R vs. M"); this.isDone = true; Console.WriteLine("Terminated " + this.ballType + " Ball [ " + this.id + "]"); ball.color = BallUtils.combineColors(ball, this); ball.radius += this.radius; }
public void swallow(RegularBall ball) { //Console.WriteLine("R vs. R"); RegularBall eater, eaten; if (this.radius > ball.radius) { eater = this; eaten = ball; } else { eater = ball; eaten = this; } eaten.isDone = true; Console.WriteLine("Terminated " + eaten.ballType + " Ball [ " + eaten.id + "]"); eater.color = BallUtils.combineColors(eater, eaten); eater.radius += eaten.radius; }
public void swallow(RepellentBall ball) { ball.color = BallUtils.combineColors(ball, this); this.color = BallUtils.combineColors(this, ball); }
public void swallow(RegularBall ball) { this.color = BallUtils.combineColors(this, ball); ball.direction.dx *= -1; ball.direction.dy *= -1; }