From dab65412376d1b73381446f969c1461c24169811 Mon Sep 17 00:00:00 2001 From: Schark Date: Wed, 23 Sep 2026 23:09:55 -0400 Subject: Base prompts --- platformer/src/world.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 platformer/src/world.h (limited to 'platformer/src/world.h') 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 */ -- cgit v1.2.3-18-g5258