Implement the moveFruit and recolourFruit methods in snake.game.controller.FruitController to allow for fruit to be moved and change colours. Fruit should not occupy spaces that are currently occupies by the snake.
Implement the isCollidingWithFruit in snake.game.controller.CollisionController.
Finally, implement addSegment in snake.game.state.Snake.
The logic should be appropriately added into updateLogic in snake.game.SnakeGame.
Acceptance Criteria:
Upon the snake's head colliding with the fruit, the fruit should change location and colour.
A segment should be added to the snake when it collides with the fruit (it doesn't have to be immediately visible).
The fruit should never spawn in an occupied space (ie: where the snake is).
Implement the
moveFruit
andrecolourFruit
methods insnake.game.controller.FruitController
to allow for fruit to be moved and change colours. Fruit should not occupy spaces that are currently occupies by the snake.Implement the
isCollidingWithFruit
insnake.game.controller.CollisionController
.Finally, implement
addSegment
insnake.game.state.Snake
.The logic should be appropriately added into
updateLogic
insnake.game.SnakeGame
.Acceptance Criteria: