You can build and test a small Snake-style game for the BBC micro:bit in Microsoft MakeCode, even without a board: the browser editor includes a simulator. The micro:bit’s 5×5 LED display makes the game compact, so the controls, scoring and collision rules need to be simple and explicit. The example below is a design to implement—not an official micro:bit Snake game or a prescribed set of rules.
What you need to make the game
- Microsoft MakeCode: the micro:bit coding editor offers a blocks view and a JavaScript view. The Micro:bit Educational Foundation introduces it as a way to create code for the device in its Microsoft MakeCode guide.
- A browser: MakeCode includes a simulator, so you can preview the project without owning hardware. Microsoft’s MakeCode overview describes the editor, simulator and device workflow.
- A BBC micro:bit for handheld play: to play on a physical board, create the program and transfer it to the device. The Foundation’s getting-started coding guide explains the create-and-transfer process.
Transfer details can differ with your computer, browser and micro:bit generation, so follow the instructions shown for your setup rather than assuming every device uses exactly the same route. MakeCode’s technical overview explains compilation and transfer to the MICROBIT drive: makecode.microbit.org.
Choose rules that fit the 5×5 display
The micro:bit has 25 LEDs arranged as a 5×5 grid, plus buttons and sensors. That is enough for a tiny grid game, but the board is too small for a long visible snake or detailed interface. Microsoft’s device overview describes the display and other hardware features.
There is no single official micro:bit Snake ruleset established by the platform guides. Decide and tell players how your version behaves. One workable design is:
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- Includes the BBC Microbit V2.2 which has new speaker sensor, Built-in 25 LEDs, 2 buttons, motion sensor, buzzer, light sensor, temperature sensor, compass, radio and Bluetooth wireless features make it easy to get you started with more fun projects.
- This is an easy to use electronic board that is very versatile and can be coded many different ways. It can be integrated with other coding tools and on many platforms.
- Coding is easy with online block gui, javascript and python. Compiles to hex file, which you then copy to microbit (looks like a drive to pc)
- Box contains: 1 micro:bit v2.2, 1 USB cable, 1 battery holder, 2 AAA batteries, user guide
- Free tutorials and project ideas available on the micro:bit website. The instructions are easy to follow for a beginner to learn to code with it.
- Each lit LED represents one snake segment; a single lit LED marks the food.
- Use the A and B buttons to turn left or right relative to the snake’s current direction. This avoids needing four separate directional inputs.
- Move one grid square at a time. When the snake reaches food, add a segment and place new food on an unoccupied square.
- End the round if the head crosses the board edge or enters the snake’s body.
- Show a brief game-over pattern, then let the player press both buttons to restart.
These are tutorial design choices, not official micro:bit rules. A different control scheme is fine if it is explained and responds reliably in both the simulator and on the board.
Build the game logic in MakeCode
Start in the blocks editor if you are new to coding; switch to JavaScript view when you want to inspect or edit the text version. The Foundation’s MakeCode guide describes both views. Keep the game state small and separate it from the display drawing.
Rank #2
- Complete classroom kit: 10-unit club pack includes everything needed to get started: 10 micro:bit v2 boards, 10 micro USB cables, 10 battery holders, 20 AAA batteries, and 10 quick start guides — ideal for coding clubs, classrooms, and STEM workshops
- Built-in sensors and outputs: Each micro:bit v2 features 25 individually programmable LEDs, 2 programmable buttons, built-in speaker, microphone, light sensor, temperature sensor, accelerometer, and compass — no additional hardware required to start learning
- Wireless connectivity and AI-ready: Supports Radio and Bluetooth communication between devices for group projects and collaborative coding; technical upgrades enable students to explore AI and machine learning concepts hands-on
- Easy to program on any platform: Compatible with desktop computers via USB (480 Mbps data transfer); program using MakeCode (block-based), Python, or Scratch; backward compatible with all existing micro:bit v1 lessons, tutorials, and code
- Compact, durable, and classroom-friendly: Each board measures just 2" x 2" x 0.4" and weighs only 69g; battery-powered for portable use; designed for ages 8+ with no soldering required, making it safe and accessible for students of all skill levels
1. Represent the board
Store the snake as an ordered list of grid coordinates, with the first entry as the head. A coordinate pair ranges from 0 to 4 on each axis. Store food as another coordinate pair, and keep a direction value such as up, right, down or left. The LED at a coordinate is on when that coordinate belongs to the snake or matches the food.
2. Read turns and block instant reversal
When A or B is pressed, update the direction by one quarter-turn relative to the current direction. If instead you choose four-direction controls, ignore an input that points directly opposite the current heading; otherwise the head could reverse into the neck on the next move. Treat this as a deliberate rule and make the same rule apply in the simulator and on-device play.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsRank #3
- Microbit V2.2 is an improved version of the original micro:bit featuring a built-in speaker, microphone, touch sensor and more computing power!
- The micro:bit is completely programmable, so you can easily create your own games, music and even control robots.
- With Rich Peripheries, 2.4GHz ratio and Bluetooth 5.0, the possibilities are endless.
- 25 individually-programmable LEDs, 2 programmable buttons
- Package includes: 1x micro:bit v2.2, 1x USB cable, 1x battery holder(Not Include Batteries)
3. Advance the snake on a timed tick
On each movement tick, calculate the next head coordinate from the current head and direction. If that coordinate is food, keep the tail in place so the snake grows. Otherwise, remove the last segment after adding the new head. A fixed interval between ticks makes movement easier to follow than moving continuously in response to button presses.
4. Handle food and collisions
Before committing a move, check whether the next head is outside the 0–4 coordinate range or overlaps a body segment. For a food-eating move, account for the tail not moving when checking self-collision; for an ordinary move, a head can move into the square the tail is about to vacate. Once food is eaten, select a coordinate that is not occupied by the snake. If the board fills completely, define a win condition rather than trying to place food indefinitely.
Rank #4
- Microbit controller V2.21 is included!onboard comes with BLE, accelerometer, electronic compass, three buttons, 5 x 5 LED dot matrix, mainly used for teens' programming education.
- Specially designed this starter kit includes commonly used resistors, LEDs, sensors, LED segment display and more to get you started with 18 interesting projects at least.
- We have detailed tutorials (including an introduction, wiring diagram, test code, driver installation, Example Projects...... Step by step to explain how to use on our wiki page.
- Each sensor is packaged individually and then held in a beautiful plastic box with compartments, it must be the best kit for you, your friends, and electric newbies or hobbyists.
- All boards are well-packed after function, voltage and current testing. The kit is well packaged, with each item packed separately.
5. Draw the board and communicate status
After each move, clear the display and light the snake and food coordinates. The score can be the number of food items eaten, but a 5×5 display cannot show a continuously readable score alongside the board. A simple option is to show a short score pattern between rounds or display a game-over pattern, then use button input to restart.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Test in the simulator, then transfer to the board
Use the MakeCode simulator to check that turns, movement, food placement, growth and game-over behavior work before transferring the program. The simulator is a browser preview, not a replacement for testing the physical controls and LEDs on your particular board.
Best Value
- This BBC micro:bit v2 Club kit is upgraded with a powerful new processor housing tons more capability and also adds a new speaker and microphone!
- 25 individually-programmable LEDs, 2 programmable buttons, Light and temperature sensors, Motion sensors (accelerometer and compass)
- MEMS microphone;Speaker to play audio tones
- Wireless Communication, via Radio and Bluetooth
- Package includes: 10x micro:bit v2 boards, 10x mirco USB cables, 10x battery holders, 20x AAA batteries,10x user guides
- Open the micro:bit project in MakeCode and run it in the simulator.
- Test each turn input, ordinary movement, eating food, wall collision, self-collision and restart. Check that newly placed food never appears on the snake.
- When the behavior is correct, use MakeCode’s device-transfer options for your computer and micro:bit. The official getting-started guide covers creating and transferring code; available steps can vary by setup.
- Play on the board and adjust the movement interval or control mapping if the physical inputs feel too quick or awkward.
Simulator or physical micro:bit?
| Option | What it requires | What it is useful for |
|---|---|---|
| MakeCode simulator | A browser; no board is needed to begin. | Previewing code and checking game logic before device transfer. |
| Physical micro:bit | A BBC micro:bit and a way to transfer the program using the instructions for your setup. | Playing with the real 5×5 LED display and physical controls. |
Both options use the same MakeCode project workflow; the physical version adds the board and transfer step. A compatible data cable or battery accessory may be useful for a particular hardware setup, but neither is needed to try the simulator, and compatibility depends on the device and connection method.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




