summaryrefslogtreecommitdiff
path: root/platformer/src/world.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/world.h
parentaf03f388cbcff795158ea8345b5c876470229e8b (diff)
downloadgamedev-dab65412376d1b73381446f969c1461c24169811.tar.gz
gamedev-dab65412376d1b73381446f969c1461c24169811.zip
Base prompts
Diffstat (limited to '')
-rw-r--r--platformer/src/world.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/platformer/src/world.h b/platformer/src/world.h
new file mode 100644
index 0000000..9553938
--- /dev/null
+++ b/platformer/src/world.h
@@ -0,0 +1,40 @@
+/*
+ * ============================================================
+ * FILE: world.h
+ *
+ * PURPOSE: Public interface for "the level". Today the level is a blank,
+ * flat square of ground, and this API is how other modules ask
+ * questions about it.
+ *
+ * FITS IN: physics.c asks for the ground height and bounds. main.c asks
+ * for the spawn point. render.c asks for the extent so it knows
+ * how big a grid to draw.
+ *
+ * INTERFACE: Use these exact signatures:
+ *
+ * void world_init(void);
+ * float world_ground_height(float x, float z);
+ * Height of the ground at (x, z). Returns 0.0f for now. This is
+ * the one hook where terrain/platforms will plug in later.
+ * Vec3 world_clamp_to_bounds(Vec3 p);
+ * Returns p with x and z clamped to [-WORLD_HALF_EXTENT,
+ * +WORLD_HALF_EXTENT]. y is untouched.
+ * Vec3 world_spawn_point(void);
+ * Where the player starts / resets to: (0, 0, 0) for now.
+ * float world_half_extent(void);
+ * Returns WORLD_HALF_EXTENT (so render.c doesn't need config
+ * knowledge of the world's shape).
+ *
+ * Include "math3d.h".
+ *
+ * CONVENTIONS: Include guard: WORLD_H.
+ *
+ * NOT IN SCOPE: Level files, platforms, walls, slopes, objects.
+ *
+ * DONE WHEN: physics.c and render.c can be written using only this header.
+ * ============================================================
+ */
+#ifndef WORLD_H
+#define WORLD_H
+
+#endif /* WORLD_H */