Need help with Variable - Trying to Gamify
Feb 25, 2016
I am creating a Galactica (video) style game (from the 80's) and there is one variable/trigger that I can't figure out. I have attached the Story file.
The main objective of this activity is that if you don't click on a customer, the company will lose $500. The total currently shows $10,000 and if a customer floats off screen, then -$500 to the company. If you click on a customer, then no money is lost.
The way I have it set up:
Variables:
"Fall" is True/False
"Total" is 10,000
Triggers:
Set "Fall" to True when the motion path completes
Subtract $500 from "Total" when motion path completes if "Fall" is equal to True.
The other trigger I have is that when a user clicks on a "customer" then the state changes to Hidden.
I can get the total to subtract by $500 when animation completes
However, if a learner clicks on a "customer" then $500 is still subtracted from the Total. What I want is no money gets subtracted from the total if a learner clicks on the customer, because that means they "saved them and the company from losing money.
Any help would be appreciated.
I have tried 10 different variable/trigger combos and I'm just not sure at this point.
Thanks,
Dana
6 Replies
Ok, I'm not sure if this is the best solution. But I figured out that if I create a second motion path for each object and add two additional triggers then $500 will not be subtracted if a user clicks on a customer.
The two additional items I added:
Move "customer" on Motion Path (second one) when user clicks on the customer
Subtract 0 from "Total" when User clicks the "customer".
I have a total of 20 "customers so each "customer will have 3 Adjust Variable Triggers.
I would love to know if there is a "best" practices way to do this - I want to learn proper ways to handle the programming of triggers.
Thanks,
Dana
Have a look at the attached and see if that's what you wanted. Instead of using the same Fall variable for all objects, I use the state of each object to determine if $ are subtracted or not.
Yep that works perfectly. I forgot about the "Shape" option in the Conditions (List) screen. I was so focused on the "variable" option. Thanks Michael.
Great to hear that it worked for you. Good luck with your project!
Have you tried adding 500 when user clicks? It might subtract it and add it at the same second, because the user clicked it and the timeline ended to the user it may appear to remain steady.
This post was removed by the author
I tried to take it a step farther and have a landing spot titled "The Auditor" so that the unclicked characters would be visible as the money was subtracted, but I can't quite figure that one out. I am going to stick with Michael's solution for now...since I need to complete this course. Thanks for everyone's help and suggestions.
This discussion is closed. You can start a new discussion or contact Articulate Support.