In this recipe, we will prepare the code that will be used to keep track of each player's score and show their current score on the pixels. We will create a new class called ScoreBoard and put it into a new module called score.
This recipe will show you one way to implement a scoreboard functionality in a MicroPython-based game. This recipe will start with the initial logic of starting the game, keeping track of the score and then displaying the score on the pixels. In the next recipes, we will add more functionality to deal with incrementing the score and detecting when one of the players has won the game.