Skip to main content

0.8

Major VersionM

by Pete Prodoehl

Introduction

Build a Reaction Game and test how quickly you can press a button when an LED lights up. We'll use the LED matrix on the micro:bit as our scoreboard.

Video Overview

Featured Document

  1. We’re going to use a micro:bit along with our Bit Board and some Crazy Circuits parts to make a fun game that will test your reaction time.
    • We’re going to use a micro:bit along with our Bit Board and some Crazy Circuits parts to make a fun game that will test your reaction time.

    • Game design involves thinking about the game objective, rules, parameters, mechanics, and playability. We started with this slide exploring how our game would work.

    • A series of LEDs will light up in sequence, and when the fourth LED is lit you need to press the button. If you time it right you’ll get a point!

    • When you get 25 points you’ll win the game!

    • But wait! Each time you press the button successfully the game will speed up… and if you press the button at the wrong time you’re score will go down.

    • We’ve written all the code, and our attached PDF will show you what to change to affect the gameplay. You can make it easier or much more difficult!

    • Hey! If you prefer to use a 7 Segment Display with this project we have another version of this guide which uses a 7 Segment Display instead of the micro:bit's built-in LED matrix to show the score: Reaction Game (7 Segment Version)

  2. Using a LEGO baseplate determine your layout and then put all of your components down connecting them to the correct pins on the Bit Board using 1/8” Maker Tape. Remember, Maker Tape is conductive on both sides and all the way through, so if you need to overlap pieces of it, they’ll still make the needed connections just fine.
    • Using a LEGO baseplate determine your layout and then put all of your components down connecting them to the correct pins on the Bit Board using 1/8” Maker Tape.

    • Remember, Maker Tape is conductive on both sides and all the way through, so if you need to overlap pieces of it, they’ll still make the needed connections just fine.

    • Feel free to adjust the layout if desired. Maybe you want more space between your LEDs, or want the button placed somewhere else… As long as everything connects to the correct pin it should work fine.

    • The attached PDF for this guide has more information and details for the project.

  3. Connect a USB cable to the micro:bit and then plug it into your computer.
    • Connect a USB cable to the micro:bit and then plug it into your computer.

    • We'll be using makecode.microbit.org to program our board. It uses a simple drag and drop block interface.

    • We're going to load the following code for our Reaction Game (LED Version) program: https://makecode.microbit.org/_hi5iwTfDM...

    • The attached PDF for this guide goes into great details explaining the code and what each section does.

  4. Ready to play? Let’s do it! Once you’ve got the code loaded the game should start right away.
    • Ready to play? Let’s do it!

    • Once you’ve got the code loaded the game should start right away.

    • Get ready to press the button when the fourth LED lights up.

    • Press it at the right time and you get a point! Press it at the wrong time and you lose a point!

    • Every time you get a point the game will speed up.

    • When you win you’ll hear a victory sound and the game will restart so you can try again.

    • If you want to start over or let someone else play, just press the B button on the micro:bit to start a new game.

  5. In the attached PDF we’ve highlighted what parts of the code can be changed to adjust the gameplay. You can change the desired score, the initial speed of the game, and how much faster it speeds up after each correct press. For this game we set the defaults to what we considered to be challenging but not too difficult, you should feel free to adjust things and see what happens!
    • In the attached PDF we’ve highlighted what parts of the code can be changed to adjust the gameplay.

    • You can change the desired score, the initial speed of the game, and how much faster it speeds up after each correct press.

    • For this game we set the defaults to what we considered to be challenging but not too difficult, you should feel free to adjust things and see what happens!

Finish Line

Attached Documents

Pete Prodoehl

Member since: 03/04/2020

131 Reputation

118 Guides authored

0 Comments

Add Comment

View Statistics:

Past 24 Hours: 0

Past 7 Days: 3

Past 30 Days: 10

All Time: 49