Game Style Health Indicator
Mar 26, 2021
By
Dan Glass
Hey team,
I'm trying to figure out the best way to code/trigger the logic of a game style health indicator.
Let's say there are 5 questions throughout the module.
If you get Q1 wrong then the 5th object state changes from green to red.
If you get Q2 wrong, depending on how you did with Q1 you might need to change either the 4th or 5th objects state. And so on and so forth.
So I'd be keen to hear your thoughts on this, mainly around how to identify what's the next available green object and then state change it to red. Please see attached visual of the health indicator.
So far I have it set up on Master slides so it's visible throughout the module.
Cheers,
Dan
4 Replies
Hi, Dan.
That is a very cool idea!
My suggestion would be to use states for your health indicator. You can have six states, each with one less green bar than the previous one.
On your Slide Master, create a number variable (let's call it wrong) with a numeric value starting at 1. You can then add triggers that match the state to the number of the variable:
Once you create your questions on your Slide view, add a trigger to the Incorrect layer that adds 1 to the variable wrong.
Every time the user gets a question wrong, the health indicator's state will change to reflect that.
I am attaching my sample .story file used.
Let me know if you have questions!
Hi Maria,
Yes! Fantastic idea, that's the way to do it :-)
Thanks you.
Dan
I have been trying this, but I dont know why it does not work?
I am inserting 'freeform - pick one" everything is exactly set as you explained yet it doesnt work
My first guess is that you may need the trigger to fire sometime other than when the slide first shows, in which case you would need to change the "when" part of the triggers. I can't see what is going on, so it's just a wild guess. For a better answer, attach your .story file here.