Snake game
Hard
·
150 minutes
Prompt
Create a Snake game (example) that meets the following requirements:
- 15x15 grid
- Snake should be controlled with cursor keys (or WASD if you prefer)
- Snake should start with a length of 3
- One apple at a time should appear in a random position on the grid. When collected, it should increase the score by one, increase the snake length by one, and change to another random position
- Display a score for how many apples have been collected
- If the snake head collides with the rest of the body, the game should end
- If the snake head collides with the borders, the game should end
Submitting solutions
- Create a solution by forking one of our CodePen templates:
- Submit your solution here