Managing 'coins' in a Storyline game

I've made a very simple game in Articulate Storyline where you can earn and spend coins (attached). I've set it up so you can earn up to 2 coins, but the last screen lets you spend up to 3 coins.

Is there a variable or trigger I can use to stop you from spending more coins than you have?

I.e., You earn 2 coins. You spend 2 coins. You try to spend a 3rd coin. The activity should say "Sorry! You don't have enough coins for that."

I'd like to scale this up to an activity with 20-30 coins so the solution would need to be scalable.

Thanks for any help!

8 Replies
Michael Hinze

Louisa, have a look at the attached file and see if that's what you want. On the last slide, I added a layer that is shown when either of the buttons is clicked AND the #of coins is insufficient. Also, I added a condition on the triggers that subtract from the number of coins, to only subtract if a sufficient # of coins remains. Hope that makes sense.

Ashley Terwilliger

Thanks for that example Michael, and the only update I made was a condition to the state changes for the "Prize" shapes on the last slide. They were showing no matter if you had enough coins or not, so I set up a condition to only changed it when the value of coins was greater than or equal to what you would need to "purchase" that amount. 

Michael Hinze

Ashley Terwilliger said:

Thanks for that example Michael, and the only update I made was a condition to the state changes for the "Prize" shapes on the last slide. They were showing no matter if you had enough coins or not, so I set up a condition to only changed it when the value of coins was greater than or equal to what you would need to "purchase" that amount. 


Now that's team work. Awesome, thanks Ashley!