Sodaholic
Banned

Posts: 2204
Registered: 04-07 |
Well, I got this working as intended. Maes suggested to me that I use an "unjump" flag, so that it would be 1 if the jump button is NOT being pressed. After implementing this, the jumping feels very Mario-like now. If you're wondering about the rather low values of vertical momentum, note that the gravity is lower.
Ladna said:
You're gonna have to get a little more serious if you want this behavior. This is a 1-time check for the jump button, and it propels you 6.33 whatevers that 1 time.
My approach would be to figure how that works out over TICs. Say for example the top height (assuming normal gravity) is reached after 10 TICs. You can check every TIC to see if the jump button is held and add another 6.33/10 momz thrust. You would also have to see how many thrusts you'd already applied so you don't jump infinitely.
Surprisingly, many games from the era that did this with jumping didn't handle it the way you describe. It literally only did just one push that was your maximum jump height, and it would go uninterrupted only as long as you still held the jump button down, otherwise it would cap off your vertical momentum if it was already above the cap's value. Mario and Sonic did it this way, at least.
wesleyjohnson said:
Unless this player character has wings or a jet pack, Why are they able to modify their path after leaving the ground ??
because vidya gaim logic
Chungy pretty much explained it better than I could.
|