summaryrefslogtreecommitdiff
path: root/platformer/src/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'platformer/src/config.h')
-rw-r--r--platformer/src/config.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/platformer/src/config.h b/platformer/src/config.h
index 1aa6447..5f1e3db 100644
--- a/platformer/src/config.h
+++ b/platformer/src/config.h
@@ -81,4 +81,58 @@
#ifndef CONFIG_H
#define CONFIG_H
+/* ---- Window ------------------------------------------------------------ */
+#define WINDOW_WIDTH 1280 /* starting window width, pixels */
+#define WINDOW_HEIGHT 720 /* starting window height, pixels */
+#define WINDOW_TITLE "platformer" /* base title; main.c appends the debug readout */
+#define SKY_COLOR_R 0.45f /* clear color: the "sky" behind everything */
+#define SKY_COLOR_G 0.65f
+#define SKY_COLOR_B 0.90f
+
+/* ---- Simulation timing ------------------------------------------------- */
+#define TICK_HZ 60 /* logic ticks per second; higher = lower input latency (SM64 used 30) */
+#define TICK_DT (1.0f / TICK_HZ) /* seconds per tick; derived, don't edit */
+#define MAX_FRAME_TIME 0.25f /* longest frame we catch up on; stops a "spiral of death" after a stall */
+
+/* ---- Input ------------------------------------------------------------- */
+#define MOVE_DEADZONE 0.20f /* left stick radius ignored; higher = less drift, less fine control */
+#define LOOK_DEADZONE 0.20f /* right stick radius ignored; higher = camera harder to nudge */
+
+/* ---- Player: ground movement ------------------------------------------- */
+#define PLAYER_MAX_SPEED 9.0f /* m/s at full stick tilt; higher = faster top run speed */
+#define PLAYER_GROUND_ACCEL 30.0f /* m/s^2 toward target speed; higher = snappier starts */
+#define PLAYER_GROUND_FRICTION 40.0f /* m/s^2 slowdown with stick released; higher = snappier stops */
+#define PLAYER_TURN_RATE 12.0f /* rad/s max facing rotation on ground; higher = tighter turns */
+
+/* ---- Player: air movement ---------------------------------------------- */
+#define PLAYER_AIR_CONTROL 0.30f /* 0..1 multiplier on accel + turn rate 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 */
+
+/* ---- 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 */
+
+/* ---- Player: size (used by render, and later by collision) ------------- */
+#define PLAYER_HALF_WIDTH 0.4f /* m; half the box's width/depth */
+#define PLAYER_HEIGHT 1.6f /* m; box height (body.pos is the player's FEET) */
+
+/* ---- Camera ------------------------------------------------------------ */
+#define CAMERA_DISTANCE 10.0f /* m from target; higher = see more, player looks smaller */
+#define CAMERA_TARGET_HEIGHT 1.0f /* m above player's feet the camera looks at */
+#define CAMERA_PITCH_DEFAULT 0.35f /* rad above horizontal at start */
+#define CAMERA_PITCH_MIN 0.05f /* rad; lowest the camera can swing (just above the ground) */
+#define CAMERA_PITCH_MAX 1.20f /* rad; highest the camera can swing (near top-down) */
+#define CAMERA_YAW_SPEED 2.5f /* rad/s orbit at full right-stick tilt; higher = faster spin */
+#define CAMERA_PITCH_SPEED 1.5f /* rad/s tilt at full right-stick tilt */
+#define CAMERA_FOLLOW_RATE 8.0f /* 1/s; higher = camera catches up to the player faster */
+#define CAMERA_FOV_DEG 60.0f /* vertical field of view, degrees; higher = wider, faster-feeling view */
+#define CAMERA_NEAR 0.1f /* m; near clip plane */
+#define CAMERA_FAR 500.0f /* m; far clip plane (must reach past the world edge) */
+
+/* ---- World ------------------------------------------------------------- */
+#define WORLD_HALF_EXTENT 100.0f /* m; the ground is a square of 2x this per side */
+#define GRID_SPACING 1.0f /* m between grid lines; the grid is how you read speed */
+#define GRID_MAJOR_EVERY 10 /* every Nth line drawn brighter, for reading distances */
+
#endif /* CONFIG_H */