Hardware Reference
In-Depth Information
All levels complete—156 points. Beat that!
CHALLENGE
Write the scores to a file on your computer and create a league table—at the
end of the game, display the player's position.
You can download the complete Crafty Crossing program on the companion website at
www.wiley.com/go/adventuresinminecraft.
It doesn't really have to be game over! The program is made so you can extend it, play
around with the settings, introduce new obstacles or create a magnificent arena. It's up
to you.
Part 4—Adding a Button
and.Display
There are a couple of problems with the Crafty Crossing program. The game starts auto-
matically, whether the player is ready or not, and there is no display of useful informa-
tion such as how many diamonds are left to collect and whether the time is running out.
In the last part of this adventure, you are going to re-use the hardware you created for the
detonator in Adventure 5 to add a button for you to press when you want the game to start.
You will also use the 7-segment display to show how many diamonds are left; the decimal
point on the display will light up when there are only five seconds left to complete the level.
What You Will Need
You will need the same electronic components you used in Adventure 5, connected the
same way you connected them in the final exercise, when you made a detonator. You
should have a breadboard set up with a 7-segment display and button, connected to
either your Raspberry Pi (see Figure 9-14) or to an Arduino (see Figure 9-15). If you
need to, look back at Adventure 5 for the set-up.
 
Search WWH ::




Custom Search