How to limit the mouse click

Get help using Construct 2

Post » Tue Feb 25, 2014 2:29 pm

Hi,
So I use a mouse to control a character, it's a platform game.
The character will jump whenever you click the mouse.
Is there a limit on how many time you can click for one action.
I want to limit it to only 2 click per jump (so it will be only jump or double jump) then you can do a double jump again once you landed on platform.
Is there a way to limit this? Sofar the character will just keep jumping in the air
Thank you,
B
4
S
1
G
1
Posts: 6
Reputation: 842

Post » Tue Feb 25, 2014 3:01 pm

You just need to add a variable on the player : "jumpNumber".
Each time he jumps, add 1 to this number. If the number is 2 or over, then you don't trigger the event. When the player lands, you reset this number to 0.
Example.
B
17
S
8
G
4
Posts: 473
Reputation: 6,211

Post » Tue Feb 25, 2014 5:45 pm

Thank you, I'll try that out.
B
4
S
1
G
1
Posts: 6
Reputation: 842


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests