Displaying a game score

Old-school Sierra adventure games in the 90s had a score system that tracked player progress. We can recreate that in Adventure Creator by using Variables and Menus.

First, go to the Variables Manager, and click Create new Global variable. We'll be working with Global variables, since they will always exist regardless of which scene is loaded.

Set the type from Boolean to Integer, and give it the name "Score", leaving the default value as 0.

Then create another Integer, calling it "MaxScore" and giving it a default value of 250.

We can use the Variable: Set action to increase the Player's score when they solve a puzzle. From any ActionList (e.g. a Cutscene or Interaction), create a new Variable: Set action. Set the Variable to affect as Score, and change the Method to "Increase By Value". Then enter "10" into the value box.

When this action is run, the Player's score will be increased by 10.

Now let's create a Menu to display the score in-game. Go to the Menu Manager and click "Create new menu" underneath the list of Menus. Give it the name "ScoreBox".

We want this Menu to be shown during regular gameplay, so set it's "Appear type" to During Gameplay. It will then play during all gameplay, unless we lock it. Leave it's Size as Automatic, but change it's Position to Aligned, and Alignment to Lower Right. Finally, change the "Element orientation" to Horizontal.

Now we'll create a label to actually display the score. Under the ScoreBox elements heading, choose the Element type Label, and click Add new.

We want our label to read something like “Score: 5 of 120”, where the 5 and 120 are the values of our Score and MaxScore variables respectively. To do this, we’ll make use of tokens.

Back in the Variables Manager, notice the Replacement token listed in each Variable’s list of properties - for Global Variables, they’ll be of the form [var:X]. The tokens in my Manager are [var:0] for Score, and [var:1] for MaxScore, though yours may be different if you already had Variables defined before starting this tutorial.

Going back to the Menu Manager, enter these tokens into the Label’s Label text field. In my case, I’ll write Score: [var:0] of [var:1]

Again, be sure to use the tokens that are listed in your own Variables Manager.

When your game runs, Adventure Creator will convert these tokens into the values of the actual Variables.

Adventure Creator and this website are copyright Chris Burton, ICEBOX Studios

Go to top
Do NOT follow this link or you will be banned from the site!