Introduction: Snake Micro:bit

I will show you how my Micro:bit snake works. step by step.

Step 1: Moving the Snake

This code makes the snake move forward every 800ms.

Step 2: 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.

Step 3: 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.

Step 4: 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.

Step 5: 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.

Micro:bit Contest

Participated in the
Micro:bit Contest