How do I Disable Touch for x amount of Seconds?

0 favourites
  • 9 posts
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • Hello,

    I am working on a Trivia game and currently when you press the correct/incorrect answer It will display a graphic, add points, remove HP from player or enemy and then load the next question.

    Well during that 5 seconds or so the player can continue to click on the answer boxes so I just wanted to turn touch off for that amount of time.

    I thought it would be easy and set it to disable touch when the "Correct/Incorrect" object appears(I have this set to go over all the answer options) that touch could be turned off.

    so I tried doing If Obj_Answer_Result Opacity = 100 then Touch = disabled but all touch offers when doing this or comparing to a variable it "Set Permission."

    Any one have a suggestion?

    Thanks,

    Rich

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well.. you can use a boolean and compare on each toucheable item if its true or false.

    So, when you need, turn it to false and after to true again.

  • Sorry I have not worked with booleans yet...do you have any examples of what you mean?

  • Hey!

    It would look like this.

    The variable touchEnabled controls when touches are active. If it's 1, touchs work, else, they don't.

    You must add this condition (if touchEnabled = 1) to all touch actions. When you want to disable touch set touchEnabled to 0 and back to 1 when it's supposed to work again.

    Hope this helps.

    Cheers.

  • Are you using C3 or C2?

    If C2 just go as brunopalermo said..

    If C3, just create a variable as boolean.

    And on each touch control compare if: is true

  • I guessed it was C2, 'cause were in the C2 forum...

    (Yeah, I get confused sometimes, too)

  • I guessed it was C2, 'cause were in the C2 forum...

    (Yeah, I get confused sometimes, too)

    True, my bad.

  • I am using CS2 so I will give bruno's suggestion a try. Thanks for the input!

  • Brilliant...worked great! Thanks folks. I actually just bought CS3 for the export functions so I might end up moving to CS3 but undecided since I know everything is working in CS3.

    thanks!

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