How do I Disable the jump button temporarily?

Get help using Construct 2

Post » Thu Jun 09, 2016 11:36 pm

My character flies up 4 times then comes down, only problem is, if you keep pressing the jump button, they still descend, but much more slowly. How do I disable the jump button until landing so descent is normal speed?
B
5
Posts: 6
Reputation: 237

Post » Fri Jun 10, 2016 3:51 am

Button l On click
Sprite l Is on floor

In a event
B
13
S
5
G
4
Posts: 119
Reputation: 3,353

Post » Fri Jun 10, 2016 5:46 am

Sounds like you're creating a manual jump button.

I think C2 has a built-in Platformer engine that disables continuous jumping like you described, however, if you'd like to implement it yourself, I suggest using a Boolen.

For [BUTTON PRESSED] | Player Jumps
JUMP_BOOLEAN = 0 |

For [ANY BUTTON PRESSED END] | Player descends
For X [BUTTON PRESSED] | JUMP_BOOLEAN = 1

For Player is Overlapping with ground | JUMP_BOOLEAN = 0

Or something like that. As you can see player is only able to jump when colliding with ground.
Of course, you'd have to fix it so player can't jump every time it's colliding with solid otherwise it'll do Wall jumps.
Image Image Image
B
31
S
11
G
27
Posts: 748
Reputation: 17,093


Return to How do I....?

Who is online

Users browsing this forum: Armench, Artcadev, farsen, mariusvm, PROxMTswatTR and 17 guests