Creating a multiplayer quick-reaction game

Lead Image © kudryashka, 123RF.com

Beat the Buzzer

The quick-reaction game provides an introduction to building simple circuits with the Raspberry Pi and controlling those circuits with ScratchGPIO, an advanced version of Scratch.

In this physical computing example, I'll walk through the steps for creating a two-player game to see who has the fastest reaction time to a randomly displayed light. The object of the game will be to see which player can react faster by being the first person to click on the buzzer. I'll create some controls to minimize cheating, and the game will keep score, so there will be a winner and bragging rights.

Besides providing a friendly game among two friends, this project will show you how to build simple circuits that can be detected and controlled with Scratch. You'll need a light-emitting diode (LED), two push-button switches, three 330-ohm resistors, a breadboard, and wire leads to connect the breadboard to the GPIO of the Pi.

You'll need to complete three main steps: Install ScratchGPIO5 to access the general-purpose input/output (GPIO) pins on the Raspberry Pi, use Scratch to send output to the GPIO pins to turn on a light, and detect input on the pins when a player presses the buzzer.

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF

Pages: 3

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content