Help with Double Jump

Get help using Construct 2

Post » Sat Aug 16, 2014 4:47 pm

I have an autorunner game and i've searched the forums here for double jump.

I've found how to do it and managed to insert it into my game, but i have one small issue with it that i was hoping someone can help with.

The double jump works fine when the player is on the platform, but when my player runs or falls of the platform (no jumping), my player only does the one jump instead of a double.

I've tried various ways of trying to fix this such replicating the double jump but instead of X platform is on floor, i've replaced it with platform is falling but no luck.

Can someone help?
You do not have the required permissions to view the files attached to this post.
B
5
S
2
Posts: 116
Reputation: 867

Post » Sat Aug 16, 2014 9:56 pm

Perhaps you could make a jump variable. Have 0 be no jumps and have 2 mean you can't jump anymore. When you hit the ground it resets to 0.

That way you could fall off and still get 2 jumps.
B
8
S
1
Posts: 76
Reputation: 949

Post » Sat Aug 16, 2014 10:38 pm

Instead of using the simulate jump action, make the first jump be used the same way that the second jump is used (setting Y velocity).
The simulate jump action can only be done if the player is on the floor, but if you want the player to be able to jump in the air that would be a way to do it. Haven't looked at the code but I hope that helps.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Sun Aug 17, 2014 12:26 pm

@Sushin I tried that, and it did kind of work but there are some things i don't like with this. When my player does a double jump, he doers this this motion where he moves back and forth in the air, which doesn't look great. Also, my players starts going through platforms with this.

Any other suggestions on how to do this?
B
5
S
2
Posts: 116
Reputation: 867

Post » Sun Aug 17, 2014 5:39 pm

Set a variable to count the jumps. Every time player jumps add 1 to the variable.
Now create a condition:
On up arrow pressed and
if jumpVariable<2 set y vector to -500 //this will make your character jump
add 1to jumpVariable

Also add a condition for setting jumpVariable to zero when your character touches the ground
B
28
S
10
G
10
Posts: 97
Reputation: 6,584

Post » Sun Aug 17, 2014 7:03 pm

May be take a look at the Platform + behavior in the addons section? Its the normal platform behavior but with wall jump and double jump implemented, it works well
B
13
S
3
Posts: 101
Reputation: 1,238

Post » Mon Aug 18, 2014 4:01 am

How about trying this? It doesn't launch him forward like the other way that I tried.

If this isn't exactly what you wanted it's at least a step in the right direction.
You do not have the required permissions to view the files attached to this post.
B
8
S
1
Posts: 76
Reputation: 949

Post » Mon Aug 18, 2014 2:37 pm

@izicial @makotto Thanks but unfortunately this jump launches my player forward.

@sachos345 I tried the Platform + addon but i still get the same issue...
B
5
S
2
Posts: 116
Reputation: 867

Post » Mon Aug 18, 2014 6:40 pm

Mmm still, in most game that have double jump when you fall you only can give one jump.

The problem you have with replacing X is on floor with X is falling is that the first jumps "desactivates" the "X is falling" because now you are jumping.
B
13
S
3
Posts: 101
Reputation: 1,238

Post » Tue Aug 19, 2014 1:19 am

SteveKane wrote:@izicial @makotto Thanks but unfortunately this jump launches my player forward.

@sachos345 I tried the Platform + addon but i still get the same issue...


He doesn't launch forward when I do it. I think I had to delete something from your original code.
B
8
S
1
Posts: 76
Reputation: 949

Next

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 20 guests