Disabling a specific keyboard key in a specific situation

Get help using Construct 2

Post » Sun Jun 26, 2016 9:16 pm

Hi there,
There are some parts in my game where my character enter "crouch mode" to cross some tight areas (I'm using the CTRL key), but if I press the CTRL key again, while crouched in these areas, my character will stand up and get stuck forever.
So I'd like to know if there's a simple workaround for this, something like:

If the char is in the tight area AND is in crouching mode, the CTRL key is disabled (so he won't stand up under these conditions)

If this is possible, how do I do it?
Someone please help in simple words cause I'm not good with the programming part of C2! :?
Thanks in advance
B
10
S
2
G
1
Posts: 26
Reputation: 1,128

Post » Mon Jun 27, 2016 6:38 pm

You could assign a "IsCrouching=true" variable to the player instance, and check it before standing up.
B
17
S
7
G
1
Posts: 157
Reputation: 1,878

Post » Mon Jun 27, 2016 11:33 pm

thanks, I'm not sure if I can make it, but I'll try!
B
10
S
2
G
1
Posts: 26
Reputation: 1,128

Post » Tue Jun 28, 2016 1:05 pm

I have no idea how your layout looks like.
I suppose it is close to this ...

https://drive.google.com/open?id=0B1SSu ... GhPU3ZkSjA
B
33
S
18
G
27
Posts: 2,455
Reputation: 20,374


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, tarek2 and 7 guests