In this recipe, we will start to build our main event loop. Each player will be assigned a single push button to press during the game. Player 1 will be assigned push button A, and player 2 will be assigned push button B. The event loop will continually check each of these buttons, looking for new button press events. When a new push button event is detected, it will print a message.
This will be further expanded in the next recipes in this chapter, in order to add the rest of the Button Bash game's functionality. Event loops can be found in many types of software applications. Exploring their usage can help you whenever you have to make your own, or when you have to interact with a built-in event loop.