In This Chapter
Making a sauce bottle simulator
Reading a digital input
Creating realistic graphics
Understanding the beginnings of the Pygame framework
The project in this chapter is just about the most fun you can have with a single contact input. Whether you call it catsup, ketchup, or sauce, it’s a thixotropic fluid, which means it changes its viscosity (runniness) according to the agitation of the fluid.
The game is simply an interactive sauce bottle where shaking can be sensed by the Raspberry Pi. This is mirrored on the screen by a graphic of the same bottle. However, on the screen, the sauce bottle can be seen to slowly empty in response to the shaking. The idea is to get the bottle emptied in the shortest possible time.
This game is a great introduction to the interaction of hardware and software. Figure 5-1 shows the hardware bottle next to a monitor showing the graphic bottle.
The parts ...