On key pressed/down/on released but for Global #s?

Get help using Construct 2

Post » Tue Apr 16, 2013 6:45 am

Hi,

I've been stumped searching for an answer and it's been hard to even phrase the question but I think I've got it now.

I am trying to setup a state machine based on GlobalNumbers. It's easy enough to tell it when to switch from one to another but I'm wondering if there's a way to monitor not only when it's on and off but whenit switches on and off.

The best example is in the way Construct 2 monitors a keyboard. That I can watch for when it is first pressed, when it's on and when it's released:


I'd like to set up this same behavior but with a variable, like below:


I want to watch for when the Spacebar variable switches from 0 to 1, when it's on 1 (can do this already) and when it switches from 1 to 0.

Is this possible and if so, how?

Thanks in advance for any help.
B
5
Posts: 20
Reputation: 1,015

Post » Tue Apr 16, 2013 12:19 pm

B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Tue Apr 16, 2013 1:35 pm

here's a simple solution
basicEventBasedStateMachine.capx
Last edited by Yann on Sun Sep 14, 2014 7:23 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Wed Apr 17, 2013 6:14 pm

Awesome, thanks so much!
B
5
Posts: 20
Reputation: 1,015


Return to How do I....?

Who is online

Users browsing this forum: Lof, Yahoo [Bot] and 25 guests