diff options
| author | Schark <jordan@schark.online> | 2026-09-24 00:06:00 -0400 |
|---|---|---|
| committer | Schark <jordan@schark.online> | 2026-09-24 00:06:00 -0400 |
| commit | 5d078ec17b27afd159f8b9a8c1298fcac15d695d (patch) | |
| tree | 59c2d29d64933e849f17bb50d34ea71b88c13602 /platformer/src/controls.h | |
| parent | 23ef8bc20310bdfad52b07a3f1e4e61c98896841 (diff) | |
| download | gamedev-5d078ec17b27afd159f8b9a8c1298fcac15d695d.tar.gz gamedev-5d078ec17b27afd159f8b9a8c1298fcac15d695d.zip | |
Fix recentering, default button
Diffstat (limited to '')
| -rw-r--r-- | platformer/src/controls.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/platformer/src/controls.h b/platformer/src/controls.h index fc2ac4d..972ce9e 100644 --- a/platformer/src/controls.h +++ b/platformer/src/controls.h @@ -20,6 +20,8 @@ * bool jump_held; A is down this tick * bool jump_pressed; A went down THIS tick (true for one tick only) * bool reset_pressed; Back/Select went down this tick (one tick only) + * bool recenter_pressed; right stick click went down this tick (one tick + * only): swing the camera behind the player, centered * bool quit_pressed; Start (or Esc) went down this tick (one tick only) * bool using_gamepad; true if a gamepad produced this Input (debug info) * } Input; @@ -48,13 +50,14 @@ #include "math3d.h" typedef struct Input { - Vec2 move; /* left stick after deadzone, length 0..1. +x = right, +y = forward */ - Vec2 look; /* right stick after deadzone, length 0..1. +x = orbit right, +y = tilt up */ - bool jump_held; /* A is down this tick */ - bool jump_pressed; /* A went down THIS tick (one tick only) */ - bool reset_pressed; /* Back/Select went down this tick (one tick only) */ - bool quit_pressed; /* Start (or Esc) went down this tick (one tick only) */ - bool using_gamepad; /* true if a gamepad produced this Input (debug info) */ + Vec2 move; /* left stick after deadzone, length 0..1. +x = right, +y = forward */ + Vec2 look; /* right stick after deadzone, length 0..1. +x = orbit right, +y = tilt up */ + bool jump_held; /* A is down this tick */ + bool jump_pressed; /* A went down THIS tick (one tick only) */ + bool reset_pressed; /* Back/Select went down this tick (one tick only) */ + bool recenter_pressed; /* right stick click went down this tick (one tick only) */ + bool quit_pressed; /* Start (or Esc) went down this tick (one tick only) */ + bool using_gamepad; /* true if a gamepad produced this Input (debug info) */ } Input; void controls_init(void); |
