Game Development Reference
Updating a score
Most games keep track of whether a player has won or lost by updating a score, based on how well
the player is performing. The following example shows you how to update a score and end the game
when a certain score has been reached.
You'll write this code in three parts. The first part gets the basic system running, but you'll immediately
see a problem with it that will illustrate a valuable concept to keep in mind when dealing with collision
detection. You'll solve the problem in the second part.
1. You first need to create a new qejp variable call o_kna to store the player's score. Update the
I]ej[Lh]ucnkqj` class definition and the ejep method with the following new code in bold:
2. Add the following new code to the kjAjpanBn]ia method: