In this chapter, we will create a two-player game called Button Bash that you can play directly on Circuit Playground Express without a computer. Each player must press their push button as fast as they can. Each press of the button increases that player's score by one point. The players' current scores will be shown visually with the NeoPixels. The first player that reaches a score of 20 points wins the game.
To create this game, we will combine button input with light output through the NeoPixels and with audio output through the built-in speakers. This chapter contains a number of recipes, each showing different parts of the game, and we combine all of these pieces in the final recipe to produce the complete game.
In this chapter, we will cover the following topics:
- Creating a class to detect a button state change
- Creating your own Python modules...