How do I reset "Jump" without landing?

Just started using Construct 2? Post your questions here

Post » Mon Apr 20, 2015 9:44 pm

Hello all,

I'm working on a platformer that allows double jumping and "goomba stomping/bouncing off" enemies. The double jump is using the already included double jump mechanics and work fine. For "Goomba Stomping" I use:

+Player On Collision with Goomba
- Player.Y < Goomba.Y -> Goomba Destroy
Player: Set Platform vector Y to -400

- Player.Y >- Goomba.Y -> Restart Layout


The issue I'm having is that I'd like to be able to jump after landing on the Goomba. So far I can only activate an Double Jump after the "bounce" if I used a single jump to get on top of it. Thanks for any and all comments.
Last edited by Cortez527 on Mon Apr 20, 2015 10:21 pm, edited 1 time in total.
B
5
Posts: 9
Reputation: 243

Post » Mon Apr 20, 2015 9:55 pm

You'll probably have to implement your own double jumping.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,630

Post » Mon Apr 20, 2015 10:09 pm

Turns out it was easier than I expected it to be. Here's my Solution in case anyone is interested:

1) Add Boolean instance variable "DoubleJump (False) to Player

2) +Player On Collision with Goomba
- Player.Y < Goomba.Y -> Goomba Destroy
Set Boolean "DoubleJump" to True
Player: Set Platform vector Y to -400

Touch: Any Touch Start
OR
Keyboard: Any Key Pressed
: Player is DoubleJump -> Set Player Vector Y to -750
Set Boolean "DoubleJump" to False

3) Player On Landed -> Set Boolean "DoubleJump" to False
B
5
Posts: 9
Reputation: 243


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests