Log In  

Hello!

I am making a new metroidvania and i feel like a critical part of this is getting the jumping to feel right. I tinkered with it for a while before i realised that a true metroidvania really needs variable jumping, where the longer the button is pressed the higher you go. I have had some issues with implementing this and i would appreciate some help.

Thanks!

P#77447 2020-05-31 08:24

2

Hello again. (I know, I'm answering a lot of these.)

This is my solution. In essence, I use a boolean to see if the jump btn is being held, and a counter to see for how long it has been held so I can stop the jump after a given amount of time. There's a little more to it than that (it could probably be simplified a bit); I have commented most of the code paths.

Cart #remcode_var_height_jump-0 | 2020-05-31 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Having coded it, I then searched the bbs ("variable height jump"); you might find these of further interest, particularly if my code is unsuitable for adaption to your cart.

Advanced Micro Platformer - Starter Kit: https://www.lexaloffle.com/bbs/?tid=28793

Given that the above has more to it than the jump method, and has been derived from a game (so, tested in a game, rather than mine which isn't), you might find it a more useful starting point than my code; it has also been released under an attribution license. But then if you already have some code, it might be that all you need is the jump, and then perhaps either will do as either will require some editing.

Ideal Mario Bros Jumping Method: https://www.lexaloffle.com/bbs/?tid=3981

Platformer Test (same poster as "Ideal Mario Bros..."): https://www.lexaloffle.com/bbs/?tid=3989

This cart (again also released under an attribution license) appears to use a variable height jump: Jumpman: https://www.lexaloffle.com/bbs/?tid=30815

P#77451 2020-05-31 12:48 ( Edited 2020-05-31 13:46)

Thanks again remcode! At this rate, you'll be in the special thanks of all my games xD. Bermeja is nearly finished, just have to make the few final screens and the ending. I started this for a little break after focusing so much on one game.

P#77453 2020-05-31 13:32

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-18 10:57:26 | 0.011s | Q:18