Stop event from occurring again?

0 favourites
  • 4 posts
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • Hi,

    Basic event system question. I'm new to C2 and have no programming background.

    I'm trying to create educational games for the classroom.

    The basic user experience is: hear a command, do it. Hear another command, do it.

    I created a crude example that highlights my problem with the event system.

    For example: user hears, "touch the wine" and touches the wine, whereupon he hears an affirmative "good." User then hears, "touch the eggs." So he should touch the eggs and hear another "good." BUT...even if the user goofs and touches the wine (instead of the eggs)he still is rewarded with an affirmative "good." So the response to the verbal command no longer makes sense. This is because my prior event says that clicking or touching the wine creates the action of the audio playing "good." So I need to create that command-and-response kind of pattern but haven't been bright enough to figure it out for myself yet. Anyone care to set me straight?

    Capx location: docs.google.com/open

    Thanks in advance.

    Erik

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Assuming you don't want to make invisible the objects as they're touched, your best way to keep track of the current objective would be with instance variables.

    Your link gives me a 404, so I'll approximate what I mean:

    Create an instance variable for each sprite, a boolean called "target" or something. Set to false to begin with. Then, along with each touch condition, create another condition that the sprite's target must be true to perform the actions.

    Now what you want to do is create the mechanism for altering that boolean as you go along. For each new objective, you should nominate the next target by changing its variable to true. Then, when that object is touched, set its variable to false, play the sound and set the next objective's variable to true.

    I've included a very rough capx so you can see what I mean: capx

  • Thank you very much for your reply...sorry about the bad link (fixed it tonight). Can't wait to look at your example!

    Erik

  • Brilliant! That's exactly what I was looking for! Thank you very much.

    Erik

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)