예제 #1
0
파일: Snake.cs 프로젝트: PatrickSachs/Snake
 /// <summary>
 ///     Moves the snake to the given position. (If position is allowed or
 ///     forceMove true)
 ///     If the movement fails the game is lost.
 /// </summary>
 public void MoveTo(Vector2 position, bool forceMove = false)
 {
     if (forceMove || _gameController.IsPositionAllowed(position))
     {
         _firstTail.MoveTo(position);
     }
     else
     {
         _gameController.LooseGame();
     }
 }