summaryrefslogtreecommitdiff
path: root/platformer/src/player.h
diff options
context:
space:
mode:
authorSchark <jordan@schark.online>2026-09-29 22:06:45 -0400
committerSchark <jordan@schark.online>2026-09-29 22:06:45 -0400
commitadb6a882870464490a8026aed1f66b21b0e72477 (patch)
treed5fda18af1d42958d9b3f81b9566b05aabb366af /platformer/src/player.h
parent21404c26d3907cefa524878fb031e7a2022fb3d7 (diff)
downloadgamedev-adb6a882870464490a8026aed1f66b21b0e72477.tar.gz
gamedev-adb6a882870464490a8026aed1f66b21b0e72477.zip
Further movement tweaks, platforming fixes
Diffstat (limited to '')
-rw-r--r--platformer/src/player.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/platformer/src/player.h b/platformer/src/player.h
index e6fd033..035a344 100644
--- a/platformer/src/player.h
+++ b/platformer/src/player.h
@@ -37,8 +37,8 @@
* PlayerState state;
* bool heightened_movement; on for PLAYER_SECOND_JUMP_WINDOW s after
* landing a normal or retreat jump, and for the
- * whole second jump, retreat jump, wall hang
- * and every wall jump. On the ground, A gives the second
+ * whole second jump, retreat jump, wall hang and
+ * every wall jump (NOT a plain first jump). On the ground, A gives the second
* jump; in the air, it lets the player wall hang.
* float heightened_timer; s left before heightened_movement ends
* (not counted down during the second jump)
@@ -51,6 +51,8 @@
* float skid_speed; forward_speed when the skid began
* float skid_yaw; direction the skid slides (the old run
* direction; the player already faces the stick)
+ * float jump_buffer; s left on the last A press: while > 0, the first
+ * moment a jump is possible, it happens
* float wall_time; s since the current wall hang began
* float wall_jump_yaw; where a wall jump from this hang launches: the
* approach direction mirrored off the wall
@@ -113,13 +115,14 @@ typedef struct Player {
float facing_yaw; /* radians; facing vector = (sin(yaw), 0, cos(yaw)) */
float forward_speed; /* ground speed along facing_yaw, m/s (>= 0) */
PlayerState state;
- bool heightened_movement; /* second jump available (or in progress); later moves read it too */
+ bool heightened_movement; /* second-jump window, and on through second/retreat/wall jumps and hangs */
float heightened_timer; /* s left before heightened_movement ends; paused during the second jump */
bool retreating_movement; /* skidding (or in the jump out of a skid); later moves read it too */
JumpKind jump_kind; /* which jump the player is in the air from */
float skid_time; /* s since the current skid began */
float skid_speed; /* forward_speed when the skid began */
float skid_yaw; /* direction the skid slides; facing_yaw already points at the stick */
+ float jump_buffer; /* s left on the last A press; a jump fires as soon as one is possible */
float wall_time; /* s since the current wall hang began */
float wall_jump_yaw; /* a wall jump's launch direction: the approach mirrored off the wall */
bool has_last_wall; /* a wall was jumped off since the last landing... */