summaryrefslogtreecommitdiff
path: root/platformer/src/config.h
diff options
context:
space:
mode:
authorSchark <jordan@schark.online>2026-09-29 18:46:53 -0400
committerSchark <jordan@schark.online>2026-09-29 18:46:53 -0400
commit923b5928eeafd9bf969b95c4d49699d280b1ce0f (patch)
tree0210db826b4cbdfc91704dc6655652b96cbd36b4 /platformer/src/config.h
parent25992eb0baa1be5b49e8732e4b63734cdafe3b80 (diff)
downloadgamedev-923b5928eeafd9bf969b95c4d49699d280b1ce0f.tar.gz
gamedev-923b5928eeafd9bf969b95c4d49699d280b1ce0f.zip
Double jump foundation
Diffstat (limited to 'platformer/src/config.h')
-rw-r--r--platformer/src/config.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/platformer/src/config.h b/platformer/src/config.h
index 8816e98..c767709 100644
--- a/platformer/src/config.h
+++ b/platformer/src/config.h
@@ -49,6 +49,14 @@
* PLAYER_AIR_ACCEL 9.0f m/s^2 speeding up toward target speed in air
* PLAYER_JUMP_VELOCITY 14.0f m/s upward at jump start (~2.4 m apex)
* 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
+ * 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)
*
* Physics
* GRAVITY 40.0f m/s^2 (stronger than real 9.8 on purpose:
@@ -146,6 +154,10 @@
#define PLAYER_AIR_ACCEL 9.0f /* m/s^2 toward target speed in air; higher = more steerable jumps */
#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_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 */
/* ---- Physics ----------------------------------------------------------- */
#define GRAVITY 40.0f /* m/s^2; stronger than real 9.8 on purpose, real gravity feels floaty */