- Arrows to control the snake
- "P" key to stop/resume the game
- Pick up the edible to grow (yellow rectangle).
- If you try to eat yourself you lose.
- If your snake's length equals the grid (even when your snake does not cover the whole grid) you win (we do not want to play forever as in the classic snake).
- The end text and the game screen stays for 3 seconds.
- After you press "P" there is a 3 seconds cooldown, after that you can resume, same after resume.
The difficulty levels only change the time after which the snake automatically moves. In order:
- EASY - 1.5 seconds
- NORMAL - 1 second
- HARD - 0.2 second
- data package:
- Directions: the kotlin file that contains the "Directions" enum class (like the arrows: UP, DOWN, LEFT, RIGHT)
- SnakeBodyPart: data class for a single part of the snake's body
- snakelogic package:
- Snake: contains the logic for the whole snake (the body and the head)
- SnakeHead: contains the head logic, basically the movement (also contains the image of the head)
- Game: the whole Game logic and every drawing stuff
- Main.kt: the entry point for the programme
- Util.kt: the function to read any resource file