TGB High Score System

The TGB High Score System is a class that contains simple functions for adding, removing and storing High Scores for a game — the general concept behind the system is this;

[js]
%highScore = HighScores::Create();
%highScore.Load(‘~/data/levels/level1.hss’);
for(%x = 0; %x < %highScores.GetCount(); %x++) { highScoreGuiListCtrl.Add(%highScore.getScore(%x).PlayerName); highScoreGuiListCtrl.Add(%highScore.getScore(%x).PlayerScore); } %highScore.delete(); [/js] The same principal can be applied when a player needs to add a high score, you simply call %highScore.AddScore(%player) -- This function will return true or false — true meaning that the player has reached a new high score — whether your scoring system is “Top 10”, “Top 25” or “Top 3”, you can configure this when you create the HighScore object for the first time in your project, and then update or modify the setting later on.

Currently, the system is in alpha stages, but will eventually be available to the public in either a beta or stable release.

2 comments for “TGB High Score System

  1. zell
    July 26, 2010 at 12:01 am

    this function can be used on torque builder game?

  2. July 26, 2010 at 2:28 pm

    That’s what it was designed for, yes. However, it was designed for an older version of TGB and may not be valid anymore. I’m not sure if the code was ever released to the public for this either … I have not touched any Torque products in quite a while.

Leave a Reply