summaryrefslogtreecommitdiff
path: root/platformer/README.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--platformer/README.md15
1 files changed, 11 insertions, 4 deletions
diff --git a/platformer/README.md b/platformer/README.md
index a83487b..758fa1a 100644
--- a/platformer/README.md
+++ b/platformer/README.md
@@ -44,6 +44,12 @@ game until the controls feel great.
keeps the full 0..1 range usable.
- **Camera-relative controls.** "Up" on the stick means "away from the camera". The player orbits
the camera with the right stick.
+- **A framing camera, not a leash.** Like Lakitu, the camera doesn't pin the player to the center of
+ the screen. A player standing inside the resting zone (5% inside the rule-of-thirds lines) leaves
+ the camera completely still. While running, they can drift out to the thirds lines. When they stop,
+ the camera eases until they sit on the zone's edge. Off-center shots are intentional: they're
+ where the cinematic feel comes from. Clicking the right stick glides the camera behind the player
+ with them centered, and the zone rules pick up again from there.
- **A drop shadow for depth.** A dark blob directly under the character is the most important depth
cue in a 3D platformer, and it tells you where you'll land.
@@ -76,7 +82,8 @@ The game is designed for a gamepad (Xbox-style layout names; GLFW maps other pad
| Input | Action |
|---|---|
| Left stick | move (tilt amount = speed, relative to the camera) |
-| Right stick | orbit camera |
+| Right stick | orbit camera (around the player; their spot on screen is kept) |
+| Right stick click | recenter: swing the camera behind the player, centered |
| A (south button) | jump (hold longer to jump higher) |
| Back / Select | reset player to spawn |
| Start | quit |
@@ -86,7 +93,7 @@ mapping line for that GUID to `EXTRA_GAMEPAD_MAPPINGS` in `src/controls.c` (the
USB is already there).
**Keyboard fallback** (only active when no gamepad is connected, for testing): WASD = move,
-arrow keys = camera, Space = jump, R = reset, Esc = quit.
+arrow keys = camera, C = recenter camera, Space = jump, R = reset, Esc = quit.
---
@@ -102,7 +109,7 @@ arrow keys = camera, Space = jump, R = reset, Esc = quit.
| `src/world.c/.h` | The blank world: ground height and world boundaries. |
| `src/physics.c/.h` | Gravity, velocity integration and ground 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 follows the player. |
+| `src/camera.c/.h` | Third-person orbit camera that frames the player inside a screen-space zone. |
| `src/render.c/.h` | Draws the ground grid, the player box and its drop shadow. Read-only. |
**Dependency direction** (arrows mean "includes / calls"; there are no cycles):
@@ -124,7 +131,7 @@ window_poll_events()
while (enough time has built up for a tick): // fixed 60 Hz
controls_poll() -> Input
player_update() (uses Input + the camera's yaw)
- camera_update() (follows the player's new position)
+ camera_update() (re-frames the player's new position)
render_frame() // once per display frame
window_swap()
```