Ejemplo n.º 1
0
        public void Collision(IHumanPlayer player, ITakeSpace other)
        {
            var angle = player.AngleAvoiding(other);

            player.Turn(angle + 2 * Math.Sign(angle));
            s = State.Collided;
        }
Ejemplo n.º 2
0
        public void Collision(IHumanPlayer player, ITakeSpace other)
        {
            if (player.Movement == MoveState.Moving)
            {
                return;                                      // nothing to do?
            }
            double angle = player.AngleAvoiding(other);

            player.Turn(angle);
            //Console.WriteLine("Turning {0} degrees to avoid obstacle.", angle);
            hasCollidedLastTurn = true;
        }
Ejemplo n.º 3
0
 public void Collision(IHumanPlayer player, ITakeSpace other)
 {
     //Console.WriteLine("random human: I collided with {0}", other);
     player.Turn(player.AngleAvoiding(other));
 }