- Eating food makes the snake grow.
- When food is eaten, a new food appears at a random position.
- Game ends when it crashes into itself.
- Game ends if snake crashes into the wall.
- Direction changes at 90 degree angles.
- Arrow keys change direction.
- Snake is represented by a sequence of X and Y positions. a. Starts out as 3 segments.
- When the snake moves, the last item (tail position) is removed, and an item is added to the front (new head position) in the direction the snake is going.
- If the new head position is at the same position as the food's position, then the snake's tail is not removed, and the food is moved to a random position not occupied by the snake.
- If the new head position is at the same position as any of the snake's other segments, then the game is over.
Original version derived from tutorial here: https://simplegametutorials.github.io/love/snake/