When you think of building a Storyline game, it’s easy to become overwhelmed by all of the seemingly endless revisions, hours of testing, and things you don’t know or are unsure about. Even in Storyline, the idea of building a well-rounded game can be very daunting. Don’t worry, because in this three part series we will nail down the three major steps that will bring you eLearning game zen in Storyline.
Scoring and Percentage Variables
The biggest headaches that come with game development are due largely to variables and the huge role they play in a working game. In an eLearning game, the most important variables are the ones that keep and give your score at the end of the game. That is why I will be showing you how to set up these variables and how to get them working in your project.
The first step to creating and keeping track of the score of a game is to make a new number variable called Total. You will want the value of this variable be equal to the number of questions that you have in your project (and in this case, we’ll set it to 3).
The next step is to create another number variable equal to 0. This will be the bank for the correct answers, meaning that whenever someone clicks the correct answer it will add 1 to this variable. This will permit you to show the score throughout the game and then calculate the percentage at the end.
In this step, you need to be aware that there are many ways to add 1 to our “Correct” variable. The easiest way to do it is by going to the correct remediation for each question and adding a trigger that adds 1 to the eLB_Correct (or whatever you named your Correct variable) when the timeline of that layer starts. You then copy and paste this trigger to each and every remediation layer that you have in your project.
The last thing to do to show the user’s score at the end is to go to the Conclusion Slide and insert a reference for your Correct variable and your Total variable. You can add these two references into the same text box; make sure to separate the inserted references by a backslash. It may take a little bit of adjusting on the canvas to get the desired look but you now have your score laid out for your users! The next few steps are for you to be able to insert the percentage into your project.
To get a percentage, we need to divide the Correct variable by the Total variable. But if we did that, then the answer to the equation would be put in the spot of the Correct variable, since it makes adjustments to that specific variable. For example, if we answered 2 out of 3 answers correctly, the percentage would turn into .66666/3 after we ran the calculation, which of course would be incorrect. To get around this problem we need to pass the value of eLB_Correct to a placeholder. Which is the reason for making the variable eLB_CorrectPercentage.
As you can see above, we need to make a trigger on the Conclusion Slide that adjusts the variable eLB_CorrectPercentage to be equal to that of the variable eLB_Correct. Now we can do the calculating for the percentage without modifying the eLB_Correct variable on accident, thus allowing us to have the 2/3 on our Conclusion Slide along with the Percentage.
We can take the eLB_CorrectPercentage (which will have the value of eLB_Correct passed to it) and do our calculation. We need to divide the eLB_CorrectPercentage by the eLB_Total. Based on the correct responses, the new value will be a decimal. So, all we need to do is multiply eLB_CorrectPercentage by 100. This will now give us a percentage instead of decimal.
I will also be giving you the source files for this so you can follow along with what I did to accomplish this.
Taking the time (which isn’t a lot) to put in a score tracking variable and then couple it with a percentage based on the number of correctly answered questions will bring a whole new level of professionalism to your course. These numbers will give your users an idea of how they are doing in relation to the expectations that you have of them. Comment in the section below and let me know how adding scoring variables have made your games awesome. Click Here to see some different ways you can use scoring variables and percentages to make awesome eLearning games.