This final recipe of this chapter combines all the previous recipes in this chapter to create the final Button Bash game. We will upgrade the event loop by adding the ScoreBoard class that we implemented in the previous recipe. This is the last piece of the puzzle.
The final result is a main loop with only six lines of code. We have been able to achieve this result by keeping a lot of the game logic in each of the three Python modules created in this chapter. You can use a similar approach in your own projects when you find the code base has become too big and concentrated in one file or one function.