public void Collision(IHumanPlayer player, ITakeSpace other) { var angle = player.AngleAvoiding(other); player.Turn(angle + 2 * Math.Sign(angle)); s = State.Collided; }
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; }
public void Collision(IHumanPlayer player, ITakeSpace other) { //Console.WriteLine("random human: I collided with {0}", other); player.Turn(player.AngleAvoiding(other)); }