diff options
| author | Schark <jordan@schark.online> | 2026-09-29 19:14:39 -0400 |
|---|---|---|
| committer | Schark <jordan@schark.online> | 2026-09-29 19:14:39 -0400 |
| commit | 0b99c49ef6ff75e3adfa08cd03dc6bc4b1602742 (patch) | |
| tree | e09a815472001b9097a2bdea07ef63994aa45cd9 /platformer/src/config.h | |
| parent | 923b5928eeafd9bf969b95c4d49699d280b1ce0f (diff) | |
| download | gamedev-0b99c49ef6ff75e3adfa08cd03dc6bc4b1602742.tar.gz gamedev-0b99c49ef6ff75e3adfa08cd03dc6bc4b1602742.zip | |
Flip jump looking amazing
Diffstat (limited to '')
| -rw-r--r-- | platformer/src/config.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/platformer/src/config.h b/platformer/src/config.h index c767709..f496ee1 100644 --- a/platformer/src/config.h +++ b/platformer/src/config.h @@ -51,13 +51,28 @@ * PLAYER_JUMP_CUT 0.50f vel.y multiplier when A released while rising * PLAYER_SECOND_JUMP_VELOCITY 18.41f m/s upward at second-jump start (1.75x * the first jump's height, ~4.1 m apex) - * PLAYER_SECOND_JUMP_WINDOW 0.3f s after landing a jump that the second + * PLAYER_SECOND_JUMP_WINDOW 0.2f s after landing a jump that the second * jump is available (heightened_movement) * PLAYER_SECOND_JUMP_MAX_SPEED 5.0f m/s top horizontal speed during the second * jump (it trades speed for height) * PLAYER_SECOND_JUMP_SLOWDOWN 3.5f m/s^2 how fast speed above that top speed * bleeds off in the air (gradual on purpose) * + * Player: skid and retreat jump + * PLAYER_SKID_ANGLE_DEG 120.0f degrees; pulling the stick more than this + * away from the run direction skids + * PLAYER_SKID_SPEED_FRACTION 0.95f of PLAYER_MAX_SPEED; a skid needs a full + * run (or faster, once later moves exist) + * PLAYER_SKID_DURATION 0.5f s a skid lasts; it always ends stopped + * PLAYER_SKID_GLIDE_POWER 2.0f shape of the skid's braking: speed = + * start * (1 - (t / duration)^power). + * 1 = even braking; higher = glides + * longer, then plants harder at the end + * PLAYER_RETREAT_JUMP_VELOCITY 19.66f m/s upward for the jump out of a skid + * (2x the first jump's height, ~4.7 m) + * PLAYER_RETREAT_JUMP_SPEED 4.0f m/s launched toward the stick, and the top + * speed until that jump lands + * * Physics * GRAVITY 40.0f m/s^2 (stronger than real 9.8 on purpose: * platformers feel floaty with real gravity) @@ -155,10 +170,18 @@ #define PLAYER_JUMP_VELOCITY 14.0f /* m/s upward at jump start; higher = taller jumps (~2.4 m apex at 14) */ #define PLAYER_JUMP_CUT 0.50f /* vel.y multiplier on early A release; lower = shorter taps */ #define PLAYER_SECOND_JUMP_VELOCITY 18.41f /* m/s upward for the second jump; tuned to 1.75x the first jump's height (4.08 m at 60 Hz) */ -#define PLAYER_SECOND_JUMP_WINDOW 0.3f /* s after landing a jump that A gives the second jump; higher = more forgiving timing */ +#define PLAYER_SECOND_JUMP_WINDOW 0.2f /* s after landing a normal or retreat jump that A gives the second jump; higher = more forgiving timing */ #define PLAYER_SECOND_JUMP_MAX_SPEED 5.0f /* m/s top horizontal speed until the second jump lands; lower = more vertical, less distance */ #define PLAYER_SECOND_JUMP_SLOWDOWN 3.5f /* m/s^2 bleed from run speed down to that top speed; lower = more gradual, higher = more abrupt */ +/* ---- Player: skid and retreat jump ------------------------------------- */ +#define PLAYER_SKID_ANGLE_DEG 120.0f /* degrees off the run direction that counts as "pulling back"; lower = skids trigger more easily */ +#define PLAYER_SKID_SPEED_FRACTION 0.95f /* of PLAYER_MAX_SPEED needed to skid (full run or faster); lower = skid from slower runs */ +#define PLAYER_SKID_DURATION 0.5f /* s from pulling back to stopped (and the retreat jump's window); higher = longer slide */ +#define PLAYER_SKID_GLIDE_POWER 2.0f /* skid braking curve; 1 = even, higher = freer glide first, then a harder plant */ +#define PLAYER_RETREAT_JUMP_VELOCITY 19.66f /* m/s upward for the jump out of a skid; tuned to 2x the first jump's height (4.67 m at 60 Hz) */ +#define PLAYER_RETREAT_JUMP_SPEED 4.0f /* m/s launched toward the stick, and the top speed until landing; higher = travels farther */ + /* ---- Physics ----------------------------------------------------------- */ #define GRAVITY 40.0f /* m/s^2; stronger than real 9.8 on purpose, real gravity feels floaty */ #define TERMINAL_VELOCITY 50.0f /* m/s max fall speed; lower = long falls feel more controlled */ |
