How do I disable user input for 1 second

Get help using Construct 2

Post » Sat Feb 06, 2016 11:13 am

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.
B
6
Posts: 16
Reputation: 272

Post » Sat Feb 06, 2016 11:40 am

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.
Image
B
27
S
16
G
60
Posts: 889
Reputation: 34,392

Post » Sat Feb 06, 2016 11:50 am

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.
B
6
Posts: 16
Reputation: 272

Post » Sat Feb 06, 2016 12:23 pm

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.
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Sat Feb 06, 2016 3:47 pm

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.
ImageImageImage
B
71
S
21
G
203
Posts: 3,582
Reputation: 115,008

Post » Sat Feb 06, 2016 9:32 pm

Wow never knew you could disable groups
That will make things a lot easier
Thanks
B
9
S
3
Posts: 146
Reputation: 1,150


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 8 guests