Beispiel #1
0
 private void PrepareGameBeforeMovement(Snake snake, Fruit fruit)
 {
     snake.snakeParts.Add("¤");
     snake.xRoutes.Add(snake.SnakeHeadX);
     snake.yRoutes.Add(snake.SnakeHeadY);
     fruit.SpawnFruit(snake);
 }
Beispiel #2
0
        private void CheckIfFruitIsEaten(Snake snake, Fruit fruit)
        {
            Start start = new Start();

            if (snake.SnakeHeadX == Fruit.FruitXCoord && snake.SnakeHeadY == Fruit.FruitYCoord)
            {
                snake.ExtendSnake();
                fruit.SpawnFruit(snake);
                start.DisplayCurrentScore(snake.snakeParts.Count - 1);
            }
        }