Snake Micro:bit
I will show you how my Micro:bit snake works. step by step.
Moving the Snake
This code makes the snake move forward every 800ms.
Making the Food Blink.
This code will make the food blink every second. This makes it easier to see what is the food and what is the snake.
Turning Left and Right.
This is the code that makes the snake turn left and right by pressing A and B.
it makes them turn 90 degrees to the left or right.
When Starting Micro:bit.
When starting the Micro:bit, your score will be set to 0, it will spawn the snake in the middle and spawn 1 random food somewhere on the map.
Spawning New Food.
this code checks if the snake and the food is on the same light, and if they are he will ad 1 to your score and spawn a new food.