PF_STARTJUMP isn't removed while falling

Turret 49

Member
If you release the Jump key while falling after jumping, PF_STARTJUMP doesn't clear; it only clears if Jump isn't pressed while rising from a jump or bounce.
This is most noticable on any jumpspin characters, who will get their bounce height halved instantly if they're not holding jump. (see the player inputs in the gifs below)
This both makes bouncing off enemies inconsistent, and makes checking PF_STARTJUMP in Lua a bit of a crapshoot.
 

Attachments

  • srb20097.gif
    srb20097.gif
    1.9 MB · Views: 210
  • srb20098.gif
    srb20098.gif
    2 MB · Views: 197
Last edited:
This is consistent with the genesis games, and I believe is intentional. It's helpful for intentionally getting the short bounce off an enemy, which is situational but useful.
 
PF_STARTJUMP sort of serves as a backwards "has the vertical momentum been cut yet during the jump?" kind of flag; it's set initially when you start jumping, but when you let go of jump while going up it cuts the momentum and the flag is removed ...which is how the ability to have a differing jump height based on how long you hold jump works. This doesn't really make sense to do when you're falling down, as it would mean you would fall down *slower* as a result.

I'm not sure whether it *should* be applying during bouncing too, though I never really thought of that particular behaviour as a bug before, hm.
 
Hm, after quickly referencing Sonic 2 again, it seems there is a slight inconsistency with how this is handled - in the original games, your momentum could be cut again. e.g., in SRB2, if you cut your jump, and then bounce on an enemy, you're always going to get the full bounce regardless of whether you start holding jump again or not. In Sonic 2, your momentum would be cut after the bounce if you haven't started holding jump again. Though with SRB2's emphasis on mid-air abilities, it may not be a desirable change to fix that.

EDIT: for reference, this looks to be the exact behavior for each game:
SRB2: If the player is jumping, and ascending, and has PF_STARTJUMP, cut z momentum in half and remove PF_STARTJUMP. i.e., because of PF_STARTJUMP, this will only happen once per jump.

Genesis: If the player is jumping, and ascending faster than 4 px/step, cut y momentum to 4 px/step. i.e., this can happen multiple times in a single jump if the player starts moving upwards again from bouncing.
 
Last edited:

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top