If you’ve ever played Pac-Man, you have certainly tried to get a high score. As you collect dots you get points—and bonus points for fruit. When the monsters turn blue, you try to get as many as you can as the score for each one increases and you eat your way through them. Many games have a scoring mechanism that is an integral part of the game.
Scores in games are handled with variables. A variable is set at the beginning of the game and changes throughout the game, based on actions that impact the score.
In order to put the concept of Variables to use, we are going to create a treasure hunting race. Players will race to collect the most points by collecting valuable loot. Be careful, some items will subtract from your score. The player with the highest score at the end of the game will be the winner. (In single player mode, the player will try to reach a score of 100 in the fastest time possible.)
If you need a review on creating your island, refer to the Getting Started Guide.