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

Get help using Construct 2

Post » Sun Mar 12, 2017 3:32 am

ultrafop wrote:.


Yes it moves but it moves a set distance because there is no momentum calculated in so basically you are walking steps a set amount instead of actually jumping.

It is the difference of when you run to the end of a platform and jump or just stand on the end of the platform and jump. Once your player is in the air there is no platform to add momentum so you get a set jump a set distance.

It might work for the OP if all he needs is to stay in one position but it misses the mark for what I am doing.

Thanks anyway!
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Sun Mar 12, 2017 4:10 am

https://www.dropbox.com/home?preview=Yv ... entum.capx

If this doesn't do the trick, PM me. @lamar

EDIT: Here is a version accounting for both X and Y vectors depending on platform speed. It's kind of like running around on the moon lol: https://www.dropbox.com/s/c19jqkqszp8lh ... .capx?dl=0 . Infinite jump is still enabled with key down so you can see it's independent of solid ground; you'll need to fuss with that I'm sure to take into account the vines you're swinging from (assuming this solution is adequate) or your platform will just keep moving in that direction until they're back on the ground (though adjusting the local variable I added, or even adding a separate one for the X vector can be pretty helpful in padding the mount of excess movement you get with the platform speed). My guess is that you already have some variable that determines whether the player is swinging or not so that will likely be enough to stop the excess movement altogether. I can think of other solutions that aren't vector based but I figured exhausting the idea might be helpful to someone at some point, if they're interested in using the platform behavior a bit differently.
B
54
S
32
G
23
Posts: 333
Reputation: 16,591

Post » Sun Mar 12, 2017 5:22 am

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.

Then do a workaround. On descent spawn a tiny invisible platform for the player to make contact with and do his air jump.

On Is Jumping | Destroy Platform

On Is Falling | Spawn Platform @ Player.Y + 10 Pixels

Every Tick | Set Platform.X to Player.X
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995

Post » Sun Mar 12, 2017 10:05 am

MPPlantOfficial 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.

Then do a workaround. On descent spawn a tiny invisible platform for the player to make contact with and do his air jump.

On Is Jumping | Destroy Platform

On Is Falling | Spawn Platform @ Player.Y + 10 Pixels

Every Tick | Set Platform.X to Player.X


I have tried that but it gives a jerky response. You can see the player contact the platform.

I may be able to tweak gravity and increase jump strength but I think I am going to have to go with physics in order for it to maintain the momentum of the vine swing.

It works with double jump off one vine but when you contact the next vine there is no momentum for a second jump because of the way platformers are set up.

I will get my capx up and let you guys play with it and see what you come up with for a solution.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Previous

Return to How do I....?

Who is online

Users browsing this forum: Lancifer, Yahoo [Bot] and 5 guests