To start the game, press left up, right or down. Just so you know, it automatically moves in the direction you want it to move to, you don't need to press the same key a lot of times. When you eat the apple, your snake grows longer There is a variable to check the longest ever gotten. When you start the game you have 0 length. When you get food you gain 0.05 length. see the code if you want to know how this works.
Credits to Coding With Chris for a tutorial on how to make this