How do I Disable mouse click.

Get help using Construct 2

Post » Tue Nov 18, 2014 10:11 am

When the score is 100, i need to disable mouse so the player cannot click anymore until the layout is restarted.

PS: i do not wish to deactivate any groups.
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Tue Nov 18, 2014 10:23 am

Compare variable..
Var_Score = 100....Mouse Destroy :D
B
66
S
24
G
7
Posts: 1,514
Reputation: 11,039

Post » Tue Nov 18, 2014 10:24 am

uff really, is it that easy? ,what a beautiful software we have here. Thanks Korbaach

Updated: lol, you are joking. No destroy for mouse, ahaha hate you :lol:
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Tue Nov 18, 2014 10:33 am

you could hide mouse cursor when your score is 100 by Mouse set cursor to None
B
251
S
39
G
15
Posts: 1,964
Reputation: 40,721

Post » Tue Nov 18, 2014 10:36 am

cursor is gone but you still can click
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Tue Nov 18, 2014 10:45 am

i guess there is no other way than deactivating groups :-/ , too bad
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Tue Nov 18, 2014 10:53 am

I take it this is for your shooting game?

Easiest way is create a variable global or instance and call it "canclick". Then on your mouseclick for shooting add the condition "canclick=0". When it's game over or score>100 set canclick to 1. That way you can no longer shoot because "canclick" is now 1.

disableclick.capx
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Tue Nov 18, 2014 11:17 am

i did exactly as you said and it works like a sharm. BUT big problem. Your system works only when you play the game like a normal person.. But if you start clicking like crazy it somehow breaks and not working anymore and the game continues , and the restart layout not working as well. I will post a video
B
11
S
3
G
1
Posts: 419
Reputation: 1,782

Post » Tue Nov 18, 2014 11:35 am

It doesn't work as you expect it in your game because what I gave you is just a small example of what you wanted it's up to you to properly integrate it into your game.

In a couple of minutes I made it unbreakable and so it restarts properly.

disableclick.capx


Sorry if I sound harsh at the top it's not meant to be but no one can make an example that works perfectly for a game when they have no idea how it works.

Hope the new version helps :)
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Tue Nov 18, 2014 12:06 pm

I sent you Pm with my Capx. So you know exactly what is happening and also see the code, Thank you for your time
B
11
S
3
G
1
Posts: 419
Reputation: 1,782


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, brunopalermo, ST314 and 22 guests