Mouse button down?

Get help using Construct 2

Post » Thu Jan 30, 2014 12:21 pm

Hi guys,

I've discovered the option of when the user has the mouse button down, but not sure how to count how long it's held. Like a powerup feature. I tried adding Wait but that didn't seem to work.

Thanks heaps!
B
5
S
1
Posts: 44
Reputation: 465

Post » Thu Jan 30, 2014 12:37 pm

You could create a global variable MouseButtonDown

System every x seconds
-system add x to MouseButtonDown

That way you would now precisely how many seconds the button was down.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jan 30, 2014 12:45 pm

An alternative could be to use a global variable MouseButtonTimeDown:

Condition:
> Mouse Button is down
> Trigger once while true

Action:
> MouseButtonTimeDown = time

Then have another condition checking for MouseButtonTimeDown > whatever cutoff time you want for subsequent actions.
A big fan of JavaScript.
B
74
S
20
G
71
Posts: 2,228
Reputation: 44,888

Post » Thu Jan 30, 2014 1:11 pm

Check my subject.
http://www.scirra.com/forum/topic84702.html
I had the same problem but with space key.
I let a time of 0.2 s cause of maniac shooter style game.

I hope it could help you!
B
8
S
2
Posts: 35
Reputation: 838


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, Google [Bot], ignaciosimo, nickar and 39 guests