[Solved] Is there a way to wait for a keypress?

Get help using Construct 2

Post » Fri Mar 17, 2017 2:57 am

-I have a variable called Talking.
-Until space is pressed, it equals "".
-When space is pressed, it equals "Hello".

I'd like to press it again and have it say something else (ie. press it again and it says "How are you?", then again and it says "Nice day!").

I know there's the Wait function, but it only appears to be time based. Any help would be greatly appreciated!

EDIT: I think I found a way to do this in case anyone finds this and is wondering.

- Set up a second variable to count the number of times Space is released (Add 1 to Counter)
- Add conditional events for if Count = 1, Count = 2, etc. In these conditional events, set the variable's value
Posts: 1
Reputation: 327

Post » Fri Mar 17, 2017 9:45 pm

Yes using global variables is probably the easiest way.

You can put the Key Press in your main event and have that set the gobal variable and then put all the check events in sub events under that.
Banned User
Posts: 1,229
Reputation: 34,910

Return to How do I....?

Who is online

Users browsing this forum: DH The Animtor, oosyrag and 4 guests