Two player maze game for the micro:bit


Take the challenge. Make a two player maze game, powered by the micro:bit and MakeCode.
And play it with a friend. Good teamwork is needed to score points.

On this page you can find more information about how I made my cardboard maze game.
This video shows you the idea of the game, in which you score points by hitting the targets alternately:




As the video shows, the metal ball closes the circuit at the two targets.
The micro:bit keeps the score and the time. And it tells the players to which side
the ball needs to go by displaying an arrow to the left or to the right side.
Every time you score a point, you hear a cool sound.

The goal is to score as many points as you can in 1 or 2 minutes.



   Parts and tools

  • A cardboard box (about 25 by 35 centimeters)
  • Cardstock (I used a mueslie box)
  • Thin foil (aluminium foil) and/or copper tape and/or nylon conductive tape
  • Scissors (optional: hobby knife and/or awl or other piercing tool)
  • Stapler and/or glue gun and/or (double side adhesive) tape
  • Rope (2 times about 125 centimeters)
  • Micro:bit
  • Electrical wires (optional 2 M3 bolts and nuts)
  • Metal ball (or a wooden bead with aluminium foil around it or a marble with copper tape)
  • Optional: speaker










This photo shows the end result of the cardboard construction of the maze.

Please notice that the micro:bit holder is made out of cardboard too.

At two opposite corners aluminium foil pieces are added.

You need the ropes to make playing more fun. Otherwise it would be too easy.











  Step 1: Make a box with a micro:bit holder connected to it.


Start with a cardboard box with a "floor" of about 25 by 35 centimeters. Put a line at a height of about 5 centimeters.

(I didn't need to do that, because I used a box with the height of 5 centimeters.)




Draw a holder for the micro:bit BEFORE cutting the box at the line that you've drawn!


This holder should be about 7 centimeters in height. The part on the top is 6 centimeters (width) by 4 centimeters (height). See the result in the photo below.

Cut a seperate piece of cardboard of 2.5 by 12 centimeters. You can put this on the back of the holder to make it more stable. I used tape to put it on, but you can also use glue of course.






















  Step 2: Make the targets using thin foil

Fold two pieces of thin foil into strips with a width of about 2 centimeters and a height of about 8 centimeters.
Glue them on the two sites of one of the corners. I used double side adhesive tape.

These two pieces of thin foil must NOT touch each other. The electrical circuit should only be completed
when a metal ball makes contact with both pieces, allowing electrons to flow from one piece to the other.

Repeat this at the opposite corner of the box.



  Step 3: Make the barriers of the maze

  • Cut at least 4 pieces of cardstock (I used a muesli box) that have a width of 8 centimeters and have a lenght of 30 centimeters (or more if the width of your box is more than 25 centimeters).
  • Add a little flap on each side, like shown on the photo.
  • Fold each piece in half.
  • Make one or two holes in each barrier, depending on how you like to design the route of the ball in your maze.
  • Make a place for the battery of the micro:bit. Consider adding death ends like I did. You need extra pieces of cardstock for this.
  • Use a stapler or glue to connect the barriers to the box and to each other where necessary.




You can use a small awl to make folding easier. If you "draw" a line with it using a ruler, you get sharp folds.












I used a bottle with hand sanitizer to draw the holes ;-)







  Step 4: Attach ropes and put the barriers in the box.


Make 4 holes on each small side of the box.

I've used an awl to do this.

Connect the rope to the box using the holes, like shown on the photo below.

Put the barriers in the box. Use a glue gun or a stapler to attach them.























  Step 5: Connect the targets with the micro:bit




Tip: make an "extension cord and power strip" for the GND pin!

Connect one side of each target to the GND pin. To make this more easy, I connected an electrical wire between the GND pin and a piece of aluminium foil at the backside of the micro:bit holder. The targets can be connected to this piece of thin foil that more or less functions like a power strip.

The other side of each target needs to be connected to Pin 1 or Pin 2.




In the final version of my game, I used 2 M3 bolts that I connected to pin 1 and pin 2. After making holes in the micro:bit holder for these bolts, I could connect the targets on the backside of my micro:bit holder.
















  Step 6: Decorate your game (and add some extra copper tape)


This is a short instruction: decorate it the way you like. Be creative!

If you choose to paint your maze, you can add a bit of copper tape in the corners after you've painted the "floor" of the box. Make sure the two sides stay seperated. They shouldn’t touch each other.

Optional: add a speaker. I've used a speaker of Kitronik that makes a really loud sound. The sound level, however, is adjustable.

You can connect a speaker to Pin 0 and to the GND pin by using the piece of thin foil on the backside of the micro:bit holder.








  Step 7: How to code the game with MakeCode



Here's the code that I've used. Please check out the notes that explain the main features. Click edit to get notes without weird hyphenations or to see the code at all if doesn't show on the preview.




Here's a new version of the code that uses the official MakeCode extension I made that features wait until blocks. This code is probably easier to understand for people without a lot of coding experience. (Check out this page if you want to learn more about the Wait until extension.)



Note that if you're using a micro:bit V2 and want to add an external speaker, you should add an extra coding block to set the build-in speaker off.




  Extra: make a conducting ball with a wooden bead or a marble

If you don't have a metal ball, there are other options. You can put thin foil on a wooden bead or copper tape on a marble.

  • If you have a wooden bead with aluminium foil I recommend using a hammer to make a neat ball.
  • If you have a glass marble, it's better to use copper tape or nylon conductive tape. Make the sure the whole marble is covered with conductive tape.





  Questions, feedback and photos are welcome


Did you use this tutorial to make a cool maze? I'd love to see what you've made. Please share it with me and I'll add it to this page if that's okay with you.

If you have any questions or remarks about this tutorial, please let me know. Feedback is welcome. English isn't my native language, so maybe some things aren't clear because I didn't use the right words or expression in English.

You can email me at PinkyPepper.Scratch@gmail.com or reach out to me on Twitter.


Maze made in Poland




Maze game made in the Netherlands




Maze games made in Belgium





Maze games made in the USA







The students of Sweeney Elementary (Santa Fe Public Schools) in the USA did a great job making their own maze games. I love the addition of a marble container!

You can see them in this video:





Jackie Gerstein, thanks so much for sharing this video! Link to tweet of @jackiegerstein








Have fun with it!





Greetings from the Netherlands,

Martine Segers
(online better known as PinkyPepper)








More on YouTube, Twitter and Scratch

Check out my YouTube channel and Twitter account for more micro:bit projects made with cardboard and/or wood. Find project ideas for a Plinko game, a toss game, a pinball game, wooden micro:bit robots and more.

Are you interested in combining the micro:bit with Scratch? Then maybe you like to check out this Scratch studio that features micro:bit pojects made by Scratchers from all around the world: https://scratch.mit.edu/studios/5812900/.

On my YouTube channel you can also find videos which feature projects that combine the micro:bit and Scratch like a space race game with a steering wheel and foot pedals and all kind of crazy controllers for Scratch games.