How do I disable user input for 1 second

  • Hello,

    I am making a choice game and when user click on one choice user get a message (right or wrong) and that message take 1 second. That can be done with the help of wait. But how to disable user input for that time. As user input is enabled and user can click on choices immediately and this will spoil the logic. Please advice.

  • You can add a second condition to "On touch" ( I'm assuming it's for mobiles).

    On Touch SOMETHING

    (and)

    isTouchAllowed

    (do)

    some action

    Now "isTouchAllowed" can be a variable, or any other condition. For instance you might even add a check if the message is visible or not (On Touch XX and Message is not visible). There are many ways to handle this. It depends on your project.

  • Thanks for the advice. I have figured it out myself this time. Once user registered his choice system will disable all the option sprites for 2 seconds and enabled again through a function.

  • One of the things I learned early on was to create a global variable called something like "menuToggle" and when an option or menu item is selected I set menuToggle = 1

    This can then be used to disable all other screen clickable objects when one is active.

    Test for it by using:

    On touch object and menuToggle = 0

    》do something and set menuToggle = 1

    When the user closes the menu or clicks next you set menuToggle back to zero.

  • This is where Groups come in handy. Put your input events in a group, and then enable/disable the group to control all of those events at once.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wow never knew you could disable groups

    That will make things a lot easier

    Thanks

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