How do I Add this feature to the card memory example?

0 favourites
  • 5 posts
From the Asset Store
Unlock platyers earning coins, and save it with Localstorage
  • Hey, I want to add a button, using touch behavior, to act as a card face revealer on the Card Memory Match Template, on the example browser. So the idea is to have an option for the user to reveal all cards and also that the cards turn back face down after a few seconds...

    In the template, there is already a key to reveal all card using the key "S". I tried changing that action to use a touch action but then it doesnt work... Also if I add a "wait 5 sec" and then toggle again the ShowCard local variable, the action stops working from the beginning, now showing the cards at all...

    Can someone help?

    The template you find on the example browser, but here`s a copy:

    drive.google.com/file/d/14GxXcCjX5tJnrW6yAJtx_MSmvtfVuPG1/view

    The basic idea is to have an object that will fly around the screen once in a while and when the user touches it, destroys it, and the cards are revealed for only a few seconds, adding some ease to the game.

  • Of course replacing press S with a touch condition will work, I'm not sure what you did but you didn't leave it in that file?

  • well, the thing is that I cant toggle (true/false) again "showcards" automatically after 5 seconds... won`t work... I tried replacing the local variable to a global but also couldnt get it right...

    do you have a suggestion to make this:

    on touch object > toggle "show cards" (card faces visible)

    wait 5 sec

    toggle "show cards" (hide card faces)

    It is something simple, but I think to make this the whole action has to be changed and maybe use another variable...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What you added there should work? Toggle, wait 5 seconds, toggle. Or you can use a timer with action 'set timer 5' and then condition 'on timer'(when it finishes). If you change this then you will need to bring the animation events out of the press key event so they are on their own.

  • I got it to work as I wanted using this setting:

    Thanks

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