If you haven’t played snake let me give you the breakdown of this version of snake. You the player move around a line aka the snake as you eat various items your snake body gets longer. The objective is to keep eating the red dot and avoid hitting your own snake body or the edges of the screen if you do it’s game over. It’s your basic last as long as you can game and get the highest score using your quick reflexes.
Through this tutorial you will learn about adding audio. Every time our snake eats the apple he makes a gulp sound!
We will learn about collision detection by detecting when the snake eats an apple, hits the edge of the screen or collides with another part of its body.
We will take keyboard input to decide the direction our snake moves in.
Lastly we will add text to the canvas by implementing a game over screen and displaying a score that increments as you eat apples
Snake GitHub source code
Playable version of snake from tutorial (use arrow keys to move)
Alternate version of snake from GitGub user jeremystone4321 (use WASD keys to move)