How to simulate a spacebar keystroke with mouse

Get help using Construct 2

Post » Mon Dec 05, 2011 4:56 pm

Is it possible to simulate a spacebar keystroke with a left mouse click. I am making a game that lets you use both the keyboard and a mouse to control the firing of the weapons.
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Mon Dec 05, 2011 4:59 pm

Why not just do the "spacebar is pressed OR left mouse button is pressed"?
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Dec 05, 2011 5:05 pm

I did not know they put the OR in yet. If I can I would do it that way. Is the OR, Else commands in a plugin?
B
15
S
10
G
8
Posts: 107
Reputation: 4,944

Post » Mon Dec 05, 2011 5:17 pm

Oh, right, Construct 2. Well, just create two events, for spacebar and for left mouse click.

Or, alternatively, two separate events that set a variable whenever such a key is pressed and then you check that variable. Don't forget to reset it afterwards.

Actually, a local variable within event group would do just fine, it automatically resets each tick.Mipey2011-12-05 17:21:27
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Dec 05, 2011 5:24 pm

Thanks Mipey for your time and help on this.
B
15
S
10
G
8
Posts: 107
Reputation: 4,944


Return to How do I....?

Who is online

Users browsing this forum: Skebab and 6 guests