Game Design

This page takes too long to load and the images need to be modified. --MF, 7/27/23

Remove instances of first person. --MF, 7/27/23

Consider offering more hand-holding support for building these projects (for teachers). --MF, 7/27/23

In this activity, you'll start making a game (or reimagine an existing one) that uses micro:bit using light level, buttons, or tilt to be played either individually or with others.

Collect Materials

For each activity, we'll provide you with a list of materials to gather and some suggested materials.

  1. Gather Materials
    • Pencils or pens
    • Paper

Get Started

Think of a game you've played many times, and imagine how adding code could enhance the experience. You'll make a game that uses the micro:bit only or uses the micro:bit as a part to the game alongside other general craft materials.

Before building, decide whether you would like your game to be played with the micro:bit only or if you want to include additional materials. Consider these two examples as you and your partner decide what type of game to make.

Example 1: Fast Click

In this game, players click the A and B buttons as quickly as they can. After the micro:bit displays ”GO”, Player A and B will try to click their respective buttons as fast as possible. The player able to click their button 10 times the fastest wins. The LEDs will then display the letter of which player (A or B) won the round.

two people are quickly clicking the buttons of the micro:bit and the winner's name is displayed code blocks for fast click

Fast Click keeps track of the score using a variable. We first learned about variables in Unit 1 Lab 7: Dealing with Data Dos, Activity 2. Here are some key pieces of information to remember:

A variable is like a labeled box that can store a value, such as a word, a number, or a list.

Create a new variable in MicroBlocks by selecting the Variables tab on the left. Select Add a variable and give it a name that's meaningful to your project. You will then have access to set and use your variable in your script.

MicroBlocks before a variable has been added dialogue box to add a new variable newly created variable in MicroBlocks

Example 2: Skeeball

A toilet paper tube transforms into a basket for catching a ball. Alligator clips to make a homemade switch, so when the ball is inside the tube, it completes the circuit. I really like this technique and hope we can use it more! I'm also using a counter to keep track of every time the ball goes in the hole.

tube ball player scores one point by shooting the ball into the basket
suggestions from Della: change "displaycharacter" to "scroll text" and change "wait" to "wait until" --MF, 7/26/23
tube ball code blocks
Tip: Add scrolling text to your micro:bit by adding the Scrolling library in MicroBlocks. Click for a picture.
highlighted text to find the scrolling library

Tube Ball uses the input and output pins, a new input type, to determine if the ball makes it into the basket. Use the read analog pin blocks to determine whether an action has occurred or not using a switch.

An analog input pin can read a voltage level that ranges of voltages provided to your micro:bit.

A switch is an electronic device that disconnects or connects and electrical path, resulting in a circuit turning off or on.

Make a switch using your micro:bit by connecting alligator clip wires to pin 0 and GND. Start by connecting these two alligator clips together and you've got a switch! Use another conductive material like aluminum foil to add more complex shapes to your game design.

  1. Brainstorm the game that you would like to bring to life. Use micro:bit inputs and outputs that you know to incorporate into game play, such as:

    Inputs:
    • Light level
    • A or B button
    • Tilt x, y, or z

    Outputs: LED display

  2. Talk with Your Partner Think first on your own and then discuss with a partner:
  3. Write down your plans on a piece of paper. Draw out what the game will look like, including any physical materials you'll need and how your game will work.
In this activity, you made plans to make an interactive game with your partner.