public void RemoveSnakeBody() { for (int i = 0; i < SnakeBody.Count(); i++) { Console.SetCursorPosition(SnakeBodyY[i], SnakeBodyX[i]); Console.Write(" "); } }
public bool DetectBodyCollision() { for (int i = 0; i < SnakeBody.Count(); i++) { if (XPosition == SnakeBodyX[i] && YPosition == SnakeBodyY[i]) { return(false); } } return(true); }
public void DrawSnake() { Console.SetCursorPosition(GetPreviousYPosition(), GetPreviousXPosition()); Console.Write(" "); Console.SetCursorPosition(GetYPosition(), GetXPosition()); Console.Write(GetSnakeHead()); for (int i = 0; i < PreviousBodyXPositions.Count(); i++) { Console.SetCursorPosition(PreviousBodyYPositions[i], PreviousBodyXPositions[i]); Console.Write(" "); } for (int i = 0; i < SnakeBody.Count(); i++) { Console.SetCursorPosition(SnakeBodyY[i], SnakeBodyX[i]); Console.Write(SnakeBody[i]); } }