10 Keeping score
This chapter covers
- Recording the player’s points score
- Adding to the player’s score
- Subtracting from the player’s score
- Displaying the score on screen
- Checking whether the player has beaten the current high score
In the previous chapter, we added collision detection to our game and detected when our player’s bullet encountered any of our enemy objects. Next we will work through how we keep track of and change the player’s score.
Our Mega Blast game is based on Astro Smash for the Intellivision, and in that game, you increase your score by shooting various enemies and decrease your score if any of the enemies make it to the ground. This is another good reason it makes a good example game, as we get to cover both increasing ...
Get Classic Game Programming on the NES now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.