summaryrefslogtreecommitdiff
path: root/platformer/README.md
diff options
context:
space:
mode:
authorSchark <jordan@schark.online>2026-09-29 21:02:22 -0400
committerSchark <jordan@schark.online>2026-09-29 21:02:22 -0400
commit21404c26d3907cefa524878fb031e7a2022fb3d7 (patch)
tree38b2bb26d6d0c05447213edca4911ccc3887f474 /platformer/README.md
parent5f04f3ae87fb307e055d39e81f7c0c841e8a9af8 (diff)
downloadgamedev-21404c26d3907cefa524878fb031e7a2022fb3d7.tar.gz
gamedev-21404c26d3907cefa524878fb031e7a2022fb3d7.zip
Game world test with updated movement
Diffstat (limited to 'platformer/README.md')
-rw-r--r--platformer/README.md15
1 files changed, 10 insertions, 5 deletions
diff --git a/platformer/README.md b/platformer/README.md
index 5a91052..570a105 100644
--- a/platformer/README.md
+++ b/platformer/README.md
@@ -2,7 +2,8 @@
A small 3D platformer written from scratch in C. The only libraries are GLFW, GLEW and OpenGL.
-**Current scope:** a flat test world scattered with box platforms, one character (a box with a drop
+**Current scope:** a flat test world scattered with box platforms, a small wall course, and a 55 m cliff
+parkour course (behind spawn: generated, branching, with moving platforms), one character (a box with a drop
shadow), a third-person camera, and a gamepad. That's everything. The only goal right now is to **dial in character movement**:
running, turning, jumping and falling should feel good before anything else gets built.
@@ -40,7 +41,7 @@ plus plain box platforms to jump on) *is* the game until the controls feel great
the lower input latency noticeable, and the per-tick math stays the same either way.
- **An explicit player state machine.** SM64 has Mario "actions" (idle, walking, jumping, and so on).
We started with four states (`IDLE`, `RUN`, `JUMP`, `FALL`) and add more only when a move requires it
- (so far `SKID`).
+ (so far `SKID` and `WALL_HANG`).
- **Analog-magnitude movement.** How far you push the stick sets how fast you move. A radial deadzone
keeps the full 0..1 range usable.
- **Camera-relative controls.** "Up" on the stick means "away from the camera". The player orbits
@@ -94,6 +95,7 @@ The game is designed for a gamepad (Xbox-style layout names; GLFW maps other pad
| Right stick click | recenter: swing the camera behind the player, centered |
| A (south button) | jump (hold longer to jump higher); press again within 0.2 s of landing for a second jump 1.75× as high |
| Left stick pulled back at full run | skid; press A during the skid for a retreat jump (2× height, toward the stick; landing it also opens the second-jump window) |
+| Jump into a violet wall (second jump, retreat jump) | wall hang: cling for 0.5 s sliding slowly down; A jumps off, mirrored away from the wall |
| Back / Select | reset player to spawn |
| Start | quit |
@@ -115,7 +117,8 @@ arrow keys = camera, C = recenter camera, Space = jump, R = reset, Esc = quit.
| `src/math3d.h` | Tiny header-only vector/matrix math (`Vec2`, `Vec3`, `Mat4`). |
| `src/window.c/.h` | The window and OpenGL context (GLFW + GLEW), the clock, and swapping buffers. |
| `src/controls.c/.h` | Reads the gamepad (or keyboard fallback) into one abstract `Input` struct. |
-| `src/world.c/.h` | The test level: ground, seeded random box platforms, geometry queries and boundaries. |
+| `src/level.c/.h` | What's in the test level: seeded random platforms, the wall course, the generated cliff course, and how moving platforms move. |
+| `src/world.c/.h` | The level while the game runs: stores the boxes, moves the moving ones each tick, answers geometry queries and boundaries. |
| `src/physics.c/.h` | Gravity, velocity integration, and floor/wall/ceiling collision for a generic `Body`. |
| `src/player.c/.h` | The player's state machine. Turns `Input` into running, turning and jumping. |
| `src/camera.c/.h` | Third-person orbit camera that frames the player inside a screen-space zone. |
@@ -128,6 +131,7 @@ main ──► window, controls, world, player, camera, render
controls ──► window (keyboard fallback needs the window handle)
player ──► physics, world, controls (Input struct only)
physics ──► world
+world ──► level (level.c only uses world.h's Box type; it never calls world)
camera ──► controls (Input struct only)
render ──► player, camera, world (reads only, never modifies)
everything ──► config.h, math3d.h
@@ -138,6 +142,7 @@ everything ──► config.h, math3d.h
```
window_poll_events()
while (enough time has built up for a tick): // fixed 60 Hz
+ world_update() (moving platforms move first, so the player rides them)
controls_poll() -> Input
player_update() (uses Input + the camera's yaw)
camera_update() (re-frames the player's new position)
@@ -190,8 +195,8 @@ Suggested fill-in order (each step can be compiled before moving on):
- Richer level geometry: slopes, moving platforms, step-up onto small ledges, hand-built or loaded levels
- Camera collision (the camera can currently pass through tall platforms)
- Loading levels
-- SM64-style extra moves: triple jump, long jump, wall kick, ground pound (the second jump and the
- skid's retreat jump exist)
+- SM64-style extra moves: triple jump, long jump, ground pound (the second jump, the skid's retreat
+ jump and the wall hang/wall jump exist)
- Character model and animation
- Audio
- On-screen text/HUD beyond the FPS counter in the top-right corner