Forum Discussion

StefanieKirs743's avatar
StefanieKirs743
Community Member
5 hours ago

Card Game Number Variable

Hi!

I'm working on a project that involves a card game. There are six cards, and I would like to set it up with a number variable so that my user only needs to flip three cards to be able to move on. 

I have the general idea of the number variable in the triggers, but I seem to be missing something as I keep selecting three cards and can't get the "Exit Course" layer to appear.

What am I missing? Attachment is below.

  • This trigger is on slide 1.1:

    However, the CardCount variable never changes when the user is on that slide. So the trigger never runs.

    • In order to use "when [var] changes," the variable change needs to happen on the slide where the trigger is.
    • Since the variable doesn't change on 1.1, you need a different "when" for the trigger. 

     

    Also, triggers like these are on the Correct and Incorrect layers of the 6 scenario slides:

    The program can't run a trigger if it's already jumped to another slide. So CardCount never gets above 0. The "Add value" trigger needs to be moved above/before the "Jump to slide" trigger.

    • During development, it's a good idea to include a variable reference on the slides. That helps with troubleshooting, because you can see whether the variable is changing as expected or not. 
    • Here's more info on variables (including links to even more info): The Value of Variables | Articulate - Community 

     

    BTW, the file has a lot of triggers like this: 

    Any object with a Visited state will automatically change to Visited when clicked. So you don't need any of those triggers.