in Games/Maze/GamePage.xaml.cs [542:596]
private int TryMoveRunner(int row, int col)
{
int crumbNum = 0;
if (row == _curRow)
{
if (_curCol < col)
{
while ((!_maze[_curRow, _curCol].HasRightWall) && (_curCol < col))
{
crumbNum++;
DropBreadCrumb(_curCol, _curRow, TravelSpeed.Walk, crumbNum);
_curCol++;
AnimateMazeRunnerVisualToCell(_curCol, _curRow, TravelSpeed.Walk, crumbNum);
}
return crumbNum;
}
else if (_curCol > col)
{
while ((!_maze[_curRow, _curCol].HasLeftWall) && (_curCol > col))
{
crumbNum++;
DropBreadCrumb(_curCol, _curRow, TravelSpeed.Walk, crumbNum);
_curCol--;
AnimateMazeRunnerVisualToCell(_curCol, _curRow, TravelSpeed.Walk, crumbNum);
}
return crumbNum;
}
}
else if (col == _curCol)
{
if (_curRow < row)
{
while ((!_maze[_curRow, _curCol].HasBottomWall) && (_curRow < row))
{
crumbNum++;
DropBreadCrumb(_curCol, _curRow, TravelSpeed.Walk, crumbNum);
_curRow++;
AnimateMazeRunnerVisualToCell(_curCol, _curRow, TravelSpeed.Walk, crumbNum);
}
return crumbNum;
}
else if (_curRow > row)
{
while ((!_maze[_curRow, _curCol].HasTopWall) && (_curRow > row))
{
crumbNum++;
DropBreadCrumb(_curCol, _curRow, TravelSpeed.Walk, crumbNum);
_curRow--;
AnimateMazeRunnerVisualToCell(_curCol, _curRow, TravelSpeed.Walk, crumbNum);
}
return crumbNum;
}
}
return 0;
}