How do I keep jumping until I release the button/key

Get help using Construct 2

Post » Sat Mar 11, 2017 8:02 am

Like in fighting games where if the up key of the controller is pushed, the character continue jumping forever until the key is released.

By default platformer behavior just jumps once, and if you want another jump you need to release and push again.

Any idea how to achieve this in c2 with the platformer behavior?

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

Post » Sat Mar 11, 2017 8:21 am

Hey there! This should be pretty easy to get done :). Try this, While button (up for instance) is down, set platform vector Y to -80 (you may want to change that number, but make sure it's a negative number).
B
56
S
32
G
23
Posts: 334
Reputation: 16,643

Post » Sat Mar 11, 2017 8:39 am

Do you mean jumping when he hits the floor or continuously jumping mid-air?

For the first case it's

Is on Floor |
[Button is Down] | Simulate control > Jump
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Sat Mar 11, 2017 8:00 pm

Oh snap did I misunderstand this lol? @mpplantofficial has a good solution
B
56
S
32
G
23
Posts: 334
Reputation: 16,643

Post » Sat Mar 11, 2017 10:03 pm

you can set the double jump on in the platform settings but then the player needs to contact a platform before they can jump again.

I have not found a way to continually jump using platform because of that and air jumping does not seem possible but if someone has figured it out I would be interested as well.
Last edited by lamar on Sat Mar 11, 2017 11:28 pm, edited 1 time in total.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Sat Mar 11, 2017 11:04 pm

lamar wrote:you can set the double jump on in the platform settings but then the player needs to contact a platform before they can jump again.

I have not found a way to continually jump using platform because of that and air jumping does not seem possible but of someone has figured it out I would be interested as well.


Actually the set Y vector idea I mentioned would work for infinite air jumping, you;d just need to set a timer for it to have intervals.

On button pressed, set Y Vector to negative (your value),
On button is down, every X seconds, set Y vector to negative (you value)
B
56
S
32
G
23
Posts: 334
Reputation: 16,643

Post » Sat Mar 11, 2017 11:27 pm

ultrafop wrote:
lamar wrote:you can set the double jump on in the platform settings but then the player needs to contact a platform before they can jump again.

I have not found a way to continually jump using platform because of that and air jumping does not seem possible but of someone has figured it out I would be interested as well.


Actually the set Y vector idea I mentioned would work for infinite air jumping, you;d just need to set a timer for it to have intervals.

On button pressed, set Y Vector to negative (your value),
On button is down, every X seconds, set Y vector to negative (you value)


Nope sorry- doesn't work with Platformer behavior. It will play an animation but is not a jump and the platformer has to contact a platform in order to perform another jump.


BUT if you want to post a capx I will look at your solution.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Sun Mar 12, 2017 2:34 am

lamar wrote:
ultrafop wrote:
lamar wrote:you can set the double jump on in the platform settings but then the player needs to contact a platform before they can jump again.

I have not found a way to continually jump using platform because of that and air jumping does not seem possible but of someone has figured it out I would be interested as well.


Actually the set Y vector idea I mentioned would work for infinite air jumping, you;d just need to set a timer for it to have intervals.

On button pressed, set Y Vector to negative (your value),
On button is down, every X seconds, set Y vector to negative (you value)


Nope sorry- doesn't work with Platformer behavior. It will play an animation but is not a jump and the platformer has to contact a platform in order to perform another jump.


BUT if you want to post a capx I will look at your solution.


Here: https://www.dropbox.com/s/smtype3mr3ss5 ... .capx?dl=0

Also OP, you'll probably want to take a look at the capx, assuming you're still having problems. I made an infinite floor jumping example, an infinite non-floor jumping example, a flying example, and a double-jump example that adjusts jump height based on whether you're keeping your jump key pressed.
B
56
S
32
G
23
Posts: 334
Reputation: 16,643

Post » Sun Mar 12, 2017 3:19 am

ultrafop wrote:
lamar wrote:



I looked at the CAPX and it might work for the OP application but not for what I am doing and it does not simulate a real jump which goes forward not just up from a swinging vine. The speed the player is moving effects that jump which is missing in your example. I tried it with my game and player falls down instead of jumping because no forward momentum.

Once that player is up you are just maintaining the vector but not simulating an actual jump with momentum. I may be able to tweak it by changing gravity and and hang time.

Thanks though and maybe the OP will be able to use it. I will post my capx if I get it to work with what I am trying to do which is a Tarzan vine swinging style game.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Sun Mar 12, 2017 3:28 am

lamar wrote:
ultrafop wrote:
lamar wrote:



I looked at the CAPX and it might work for the OP application but not for what I am doing and it does not simulate a real jump which goes forward not just up from a swinging vine. The speed the player is moving effects that jump which is missing in your example. I tried it with my game and player falls down instead of jumping because no forward momentum.

Once that player is up you are just maintaining the vector but not simulating an actual jump with momentum. I may be able to tweak it by changing gravity and and hang time.

Thanks though and maybe the OP will be able to use it. I will post my capx if I get it to work with what I am trying to do which is a Tarzan vine swinging style game.


Not really actually. the player still moves along the X axis when using the Y vector jump in my example (X vector is never adjusted and the standard platform movement is used for left/right). If you'd like to discuss it more PM me since this thread looks like it's getting hijacked.
B
56
S
32
G
23
Posts: 334
Reputation: 16,643

Next

Return to How do I....?

Who is online

Users browsing this forum: alextro, Ryan Kocourek and 6 guests