summaryrefslogtreecommitdiff
path: root/platformer/src/config.h
diff options
context:
space:
mode:
authorSchark <jordan@schark.online>2026-09-23 23:09:55 -0400
committerSchark <jordan@schark.online>2026-09-23 23:09:55 -0400
commitdab65412376d1b73381446f969c1461c24169811 (patch)
tree27adfec438a9bd9f3c96a740ab54016df5f68b80 /platformer/src/config.h
parentaf03f388cbcff795158ea8345b5c876470229e8b (diff)
downloadgamedev-dab65412376d1b73381446f969c1461c24169811.tar.gz
gamedev-dab65412376d1b73381446f969c1461c24169811.zip
Base prompts
Diffstat (limited to 'platformer/src/config.h')
-rw-r--r--platformer/src/config.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/platformer/src/config.h b/platformer/src/config.h
new file mode 100644
index 0000000..1aa6447
--- /dev/null
+++ b/platformer/src/config.h
@@ -0,0 +1,84 @@
+/*
+ * ============================================================
+ * FILE: config.h
+ *
+ * PURPOSE: Every tunable number in the game, in one place. When movement
+ * "feels wrong", this is the first (and usually only) file to edit.
+ *
+ * FITS IN: Included by almost every .c file. Contains only #defines,
+ * with no functions, no types and no includes.
+ * Nothing in the game should hard-code a number that appears here.
+ *
+ * INTERFACE: Plain #define constants, float literals with an `f` suffix.
+ * Give EVERY constant a one-line comment that says what it
+ * changes about the *feel*, e.g. "higher = snappier stops".
+ * Use these exact names (other files depend on them). The
+ * values are starting points for tuning:
+ *
+ * Window
+ * WINDOW_WIDTH 1280
+ * WINDOW_HEIGHT 720
+ * WINDOW_TITLE "platformer"
+ * SKY_COLOR_R/G/B 0.45f 0.65f 0.90f (clear color)
+ *
+ * Simulation timing
+ * TICK_HZ 60 (fixed logic rate; SM64 used 30)
+ * TICK_DT (1.0f / TICK_HZ) (seconds per tick)
+ * MAX_FRAME_TIME 0.25f (clamp to avoid a "spiral of death"
+ * after a stall / breakpoint)
+ *
+ * Input
+ * MOVE_DEADZONE 0.20f (radial, left stick)
+ * LOOK_DEADZONE 0.20f (radial, right stick)
+ *
+ * Player: ground movement
+ * PLAYER_MAX_SPEED 9.0f m/s at full stick tilt
+ * PLAYER_GROUND_ACCEL 30.0f m/s^2 speeding up toward target speed
+ * PLAYER_GROUND_FRICTION 40.0f m/s^2 slowing down with no input
+ * PLAYER_TURN_RATE 12.0f rad/s max facing rotation on ground
+ *
+ * Player: air movement
+ * PLAYER_AIR_CONTROL 0.30f 0..1 multiplier on accel + turn rate 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
+ *
+ * Physics
+ * GRAVITY 40.0f m/s^2 (stronger than real 9.8 on purpose:
+ * platformers feel floaty with real gravity)
+ * TERMINAL_VELOCITY 50.0f m/s max fall speed
+ *
+ * Player: size (used by render, and later by collision)
+ * PLAYER_HALF_WIDTH 0.4f m
+ * PLAYER_HEIGHT 1.6f m (body.pos is the player's FEET)
+ *
+ * Camera
+ * CAMERA_DISTANCE 10.0f m from target
+ * CAMERA_TARGET_HEIGHT 1.0f m above player's feet to look at
+ * CAMERA_PITCH_DEFAULT 0.35f rad above horizontal
+ * CAMERA_PITCH_MIN 0.05f rad
+ * CAMERA_PITCH_MAX 1.20f rad
+ * CAMERA_YAW_SPEED 2.5f rad/s at full right-stick tilt
+ * CAMERA_PITCH_SPEED 1.5f rad/s at full right-stick tilt
+ * CAMERA_FOLLOW_RATE 8.0f 1/s; higher = camera catches up faster
+ * CAMERA_FOV_DEG 60.0f vertical field of view
+ * CAMERA_NEAR 0.1f
+ * CAMERA_FAR 500.0f
+ *
+ * World
+ * WORLD_HALF_EXTENT 100.0f m; the ground is a square of 2x this per side
+ * GRID_SPACING 1.0f m between grid lines
+ * GRID_MAJOR_EVERY 10 every Nth line drawn brighter
+ *
+ * CONVENTIONS: 1 unit = 1 meter, seconds, radians (degrees only for the FOV,
+ * converted where it's used). Include guard: CONFIG_H.
+ *
+ * NOT IN SCOPE: Runtime config files, command-line parsing, hot-reload.
+ *
+ * DONE WHEN: Every constant above exists with a comment, and no other
+ * file contains a magic number for any of these concepts.
+ * ============================================================
+ */
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#endif /* CONFIG_H */