How do I lock jump direction in platform behavior

Get help using Construct 2

Post » Mon Mar 06, 2017 4:55 am

Platform behavior allows you by default to change the direction while in air, either jumping or falling.
I will like to have like in fighting games a jump that once the players imputs the direction of it, cannot do anything but attack
until the character lands, no direction change possible.

Im thinking about disabling platform behavior once the input is done or something like that but after several tries I still without the optimal
approach for this, any ideas guys? :geek:

Thanks!
B
12
S
4
G
2
Posts: 8
Reputation: 1,816

Post » Mon Mar 06, 2017 11:43 am

Hmmm?

I would use a global variable as a trigger to keep other direction keys from being used and only make the other direction keys work when the platformer is on the platform.

Global variable OnPlatform=0

On Key Down: Move Player Left
OnPlatform=1

Player On Platform: Set OnPlatform=1

On Jump Pressed: Set OnPlatform=0

Something like that.
Banned User
B
27
S
7
G
58
Posts: 1,229
Reputation: 34,780

Post » Mon Mar 06, 2017 3:16 pm

I see, thanks for the help, will try it for sure :)
B
12
S
4
G
2
Posts: 8
Reputation: 1,816


Return to How do I....?

Who is online

Users browsing this forum: mindragon73, nahima and 25 guests