PLATFORMER: Double jump

Get help using Construct 2

Post » Wed Nov 21, 2012 1:00 pm

The vectorY iiiis basicaly the up or down force that imitates a jump movement. The difference between simulate jump and vectorY jump is that simulate jump can perform a jump only when the object is on the ground/solid object.
The vectorY can perform jump even in air but if you dont give it a specific limit, your character migh end up flying endlesly up into the air...
B
43
S
9
G
5
Posts: 231
Reputation: 7,291

Post » Mon Nov 26, 2012 7:32 pm

Edit: nvm, noob mistake.JH12012-11-26 19:34:17
B
7
S
3
G
3
Posts: 22
Reputation: 2,385

Post » Fri Jan 18, 2013 7:25 am

Thanks much for this, I had come up with my own scheme that was pretty much identical to this but had an issue where they would keep jumping as many times as I hit the button while in the air giving an infinite jumping ability and it wouldn't function if they were already on the downward arc of their jump (falling).

Turns out that it was because I based my logic on "is jumping" instead of "not on floor". It makes a world of difference. Thanks that was the one little piece that I was missing...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Fri Jan 18, 2013 7:27 am

An additional enhancement to this is that if you are using jumping animations, you should start the jump animation again when the double jump starts. For example if you use the jungle sprite sheets, the jump from idle animation works great for the double jump animation.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Tue Feb 12, 2013 4:21 pm

Thank you guys. I was having a bad moment with this issue.

Is it possible to have the same Jump Button for the Double Jump?
I tried, but it doesn't work. I tried to have the A button for both, but if the key is the jump button it doesn't work as a double jump button. Any idea?

I also changed the double jump condition to "if it's not falling" because I don't like to have a double jump when the player is falling.
B
13
S
2
Posts: 104
Reputation: 1,336

Post » Tue Feb 12, 2013 4:45 pm

You can do something like this:

Conditions:
Player is on floor
Button Pressed A

Simulate Platform Jump


Then for the double jump you do similar but

If player is NOT on floor
A button Pressed

Set Player Vector Y -500...

You can also check my tutorials for more features as well, you can find a link in my signature.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Tue Mar 05, 2013 7:11 am

Hey, I figured out a pretty effective way to do this with the up arrow.

1) define the global variable jump = 0.

2) Add event If Keyboard Up Arrow Pressed AND Player Not On Ground AND jump = 1 THEN Player Vector Y -450; Subtract 1 from jump

3) New event if Keyboard Up Arrow Pressed AND Player On Ground THEN Set Jump to 1

B
1
Posts: 1
Reputation: 227

Post » Wed Mar 06, 2013 7:18 am

@BeardoMike that is pretty much exactly the way my tutorial does it :) along with some additional logic for handling falling as well.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Wed Mar 06, 2013 9:19 am

Anything that works is always welcome to be shared :D
B
43
S
9
G
5
Posts: 231
Reputation: 7,291

Post » Sun Mar 10, 2013 5:25 pm

nice work continue helping.
B
9
S
1
Posts: 9
Reputation: 971

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Zebbi and 26 guests