Scoring - Overview
[Previous] [Main] [Next]

In some, though not all, games you may want to keep the score, awarding points for various achievements, and notifying players how they're getting on by showing their current score in relation to the maximum score available. In addition you may want to assign a descriptive rank (e.g. from 'novice' to 'hero') to the player depending on the score currently attained. In addition, you may want players to be able to see how their score is made up, with a list containing the scores for individual achievements, and aggregate scores for related achievements (such as finding the different members of a set of related items).

The TADS 3 library allows you to do all this fairly simply. You can change the player's score with a simple addToScore statement at any point, or use Achievement objects to help keep track of the point they've earned. For aggregating scores for similar feats under a common description, the SimpleAchievement class can be useful. Finally, you can set up a scoreRankTable to translate scores into descriptive ranks (e.g. "This makes you a mere blundering novice/fantastic superhero") and define the maximum score attainable.