pi-extensions 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ralph/import-cc-codex.md +31 -0
- package/.ralph/import-cc-codex.state.json +14 -0
- package/.ralph/mario-not-impl.md +69 -0
- package/.ralph/mario-not-impl.state.json +14 -0
- package/.ralph/mario-not-spec.md +163 -0
- package/.ralph/mario-not-spec.state.json +14 -0
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/RELEASING.md +34 -0
- package/agent-guidance/CHANGELOG.md +4 -0
- package/agent-guidance/README.md +102 -0
- package/agent-guidance/agent-guidance.ts +147 -0
- package/agent-guidance/package.json +22 -0
- package/agent-guidance/setup.sh +75 -0
- package/agent-guidance/templates/CLAUDE.md +5 -0
- package/agent-guidance/templates/CODEX.md +92 -0
- package/agent-guidance/templates/GEMINI.md +5 -0
- package/arcade/CHANGELOG.md +4 -0
- package/arcade/README.md +85 -0
- package/arcade/assets/picman.png +0 -0
- package/arcade/assets/ping.png +0 -0
- package/arcade/assets/spice-invaders.png +0 -0
- package/arcade/assets/tetris.png +0 -0
- package/arcade/mario-not/README.md +30 -0
- package/arcade/mario-not/boss.js +103 -0
- package/arcade/mario-not/camera.js +59 -0
- package/arcade/mario-not/collision.js +91 -0
- package/arcade/mario-not/colors.js +36 -0
- package/arcade/mario-not/constants.js +97 -0
- package/arcade/mario-not/core.js +39 -0
- package/arcade/mario-not/death.js +77 -0
- package/arcade/mario-not/effects.js +84 -0
- package/arcade/mario-not/enemies.js +31 -0
- package/arcade/mario-not/engine.js +171 -0
- package/arcade/mario-not/fireballs.js +98 -0
- package/arcade/mario-not/items.js +24 -0
- package/arcade/mario-not/levels.js +403 -0
- package/arcade/mario-not/logic.js +104 -0
- package/arcade/mario-not/mario-not.ts +297 -0
- package/arcade/mario-not/player.js +244 -0
- package/arcade/mario-not/render.js +257 -0
- package/arcade/mario-not/spec.md +548 -0
- package/arcade/mario-not/state.js +246 -0
- package/arcade/mario-not/tests/e2e.test.js +855 -0
- package/arcade/mario-not/tests/engine.test.js +888 -0
- package/arcade/mario-not/tests/fixtures/story0-frame.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story1-camera.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story1-glyphs.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story10-item.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story11-hazards.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story12-used-block.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story13-pipes.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story14-goal.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story15-hud-narrow.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story16-unknown-tile.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story17-mix.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story18-hud-score.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story19-cue.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story2-enemy.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story20-camera-offset.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story21-hud-zero.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story22-big-viewport.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story23-camera-negative.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story24-camera-width.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story25-camera-positive.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story26-hud-lives.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story27-hud-coins.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story28-item-viewport.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story29-enemy-viewport.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story3-hud.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story30-hud-score.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story31-particles-viewport.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story32-paused-frame.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story4-big.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story5-resume-hud.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story6-particles.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story6-paused.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story7-powerup.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story8-hud-time.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story9-hud-level.txt +2 -0
- package/arcade/mario-not/tiles.js +79 -0
- package/arcade/mario-not/tsconfig.json +14 -0
- package/arcade/mario-not/types.js +225 -0
- package/arcade/package.json +26 -0
- package/arcade/picman.ts +328 -0
- package/arcade/ping.ts +594 -0
- package/arcade/spice-invaders.ts +1104 -0
- package/arcade/tetris.ts +662 -0
- package/code-actions/CHANGELOG.md +4 -0
- package/code-actions/README.md +65 -0
- package/code-actions/actions.ts +107 -0
- package/code-actions/index.ts +148 -0
- package/code-actions/package.json +22 -0
- package/code-actions/search.ts +79 -0
- package/code-actions/snippets.ts +179 -0
- package/code-actions/ui.ts +120 -0
- package/files-widget/CHANGELOG.md +90 -0
- package/files-widget/DESIGN.md +452 -0
- package/files-widget/README.md +122 -0
- package/files-widget/TODO.md +141 -0
- package/files-widget/browser.ts +922 -0
- package/files-widget/comment.ts +5 -0
- package/files-widget/constants.ts +18 -0
- package/files-widget/demo.svg +1 -0
- package/files-widget/file-tree.ts +224 -0
- package/files-widget/file-viewer.ts +93 -0
- package/files-widget/git.ts +107 -0
- package/files-widget/index.ts +140 -0
- package/files-widget/input-utils.ts +3 -0
- package/files-widget/package.json +22 -0
- package/files-widget/types.ts +28 -0
- package/files-widget/utils.ts +26 -0
- package/files-widget/viewer.ts +424 -0
- package/import-cc-codex/research/import-chats-from-other-agents.md +135 -0
- package/import-cc-codex/spec.md +79 -0
- package/package.json +29 -0
- package/ralph-wiggum/CHANGELOG.md +7 -0
- package/ralph-wiggum/README.md +96 -0
- package/ralph-wiggum/SKILL.md +73 -0
- package/ralph-wiggum/index.ts +792 -0
- package/ralph-wiggum/package.json +25 -0
- package/raw-paste/CHANGELOG.md +7 -0
- package/raw-paste/README.md +52 -0
- package/raw-paste/index.ts +112 -0
- package/raw-paste/package.json +22 -0
- package/tab-status/CHANGELOG.md +4 -0
- package/tab-status/README.md +61 -0
- package/tab-status/assets/tab-status.png +0 -0
- package/tab-status/package.json +22 -0
- package/tab-status/tab-status.ts +179 -0
- package/usage-extension/CHANGELOG.md +17 -0
- package/usage-extension/README.md +120 -0
- package/usage-extension/index.ts +628 -0
- package/usage-extension/package.json +22 -0
- package/usage-extension/screenshot.png +0 -0
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
# Mario-Not Spec (Mario-Style TUI)
|
|
2
|
+
|
|
3
|
+
- Status: Draft
|
|
4
|
+
- Command: `/mario-not`
|
|
5
|
+
- Goals:
|
|
6
|
+
- A fast-boot, Mario-like platformer in the TUI that feels playable in under 10 seconds.
|
|
7
|
+
- Clear, verifiable behavior for each system so implementation can be incremental.
|
|
8
|
+
- Save/resume across sessions.
|
|
9
|
+
- Non-goals:
|
|
10
|
+
- Perfect SMB1 fidelity.
|
|
11
|
+
- Full Mario feature set (fire flower, shells, etc.) unless specified.
|
|
12
|
+
|
|
13
|
+
- Core Gameplay
|
|
14
|
+
- Player Experience & Feel
|
|
15
|
+
- Time-to-fun / quick boot
|
|
16
|
+
- Design intent:
|
|
17
|
+
- Boot to playable within a couple seconds; minimal friction.
|
|
18
|
+
- Resume saved run instantly without menus; avoid accidental movement.
|
|
19
|
+
- Show controls briefly without blocking play.
|
|
20
|
+
- Implementation details:
|
|
21
|
+
- On `/mario-not`, load saved state if present; set `paused=true` and render immediately.
|
|
22
|
+
- Resume on first non-quit input; do not show multi-screen menus.
|
|
23
|
+
- If no save, start Level 1 at the start position with `paused=false` after first render.
|
|
24
|
+
- Keep assets in code; no file/network I/O; precompute tilemaps at startup.
|
|
25
|
+
- Provide `[R] Restart` and `[Q]/Esc Quit` shortcuts at all times.
|
|
26
|
+
- Verification:
|
|
27
|
+
- New game: first rendered frame appears within 1s; first movement key moves on next tick.
|
|
28
|
+
- Saved game: pressing movement/jump unpauses immediately.
|
|
29
|
+
- No more than one keypress required to reach active play.
|
|
30
|
+
- Pace / difficulty ramp
|
|
31
|
+
- Design intent:
|
|
32
|
+
- Level 1 teaches core moves quickly: move, jump, stomp, coin, goal.
|
|
33
|
+
- Ramp from safe to moderate challenge within ~45-90 seconds.
|
|
34
|
+
- Avoid difficulty spikes; first death should feel "earned".
|
|
35
|
+
- Implementation details:
|
|
36
|
+
- Level 1 layout sequence: flat runway → low gap → coin line → single goomba → brick stack → pipe → two goombas → staircase to goal.
|
|
37
|
+
- Place first enemy after a safe flat stretch to allow movement tests.
|
|
38
|
+
- Use 1-tile-high gaps early; introduce 2-tile gap only near the end.
|
|
39
|
+
- Keep enemy density low: max 1 enemy per screen-width in Level 1.
|
|
40
|
+
- Introduce one "safe" power-up (mushroom) before first multi-enemy segment.
|
|
41
|
+
- Verification:
|
|
42
|
+
- First 10 seconds: player can run and jump without hazards.
|
|
43
|
+
- By 30 seconds: player encounters a coin line and a single goomba.
|
|
44
|
+
- By 60-90 seconds: player reaches goal if no mistakes.
|
|
45
|
+
- Failure/respawn cadence
|
|
46
|
+
- Design intent:
|
|
47
|
+
- Failures should be quick to recover from; avoid long downtime.
|
|
48
|
+
- Encourage experimentation; death feels like a short setback, not a reset.
|
|
49
|
+
- Lives/time create urgency without punishing early learning.
|
|
50
|
+
- Implementation details:
|
|
51
|
+
- On death: freeze for 0.5s, play a brief cue, then respawn at last checkpoint or level start.
|
|
52
|
+
- Checkpoints: one midpoint checkpoint in Level 1 (e.g., after the first pipe).
|
|
53
|
+
- Lives start at 3; losing all lives ends run (game over screen with restart).
|
|
54
|
+
- Timer starts at 300s per level; hitting 0 triggers death.
|
|
55
|
+
- Death causes temporary invulnerability (e.g., 2s) after respawn.
|
|
56
|
+
- Verification:
|
|
57
|
+
- Death-to-control regained ≤ 2.5s on average.
|
|
58
|
+
- Checkpoint restores progress (position, level state) while preserving score/coins.
|
|
59
|
+
- Game over triggers after 3 deaths without extra lives.
|
|
60
|
+
- Feel targets vs SMB1
|
|
61
|
+
- Design intent:
|
|
62
|
+
- Capture SMB1's tight jump arc and snappy ground control, not exact physics.
|
|
63
|
+
- Preserve "momentum" feel: fast enough to clear gaps, but not slippery.
|
|
64
|
+
- Movement must read clearly in a low-res TUI grid.
|
|
65
|
+
- Implementation details:
|
|
66
|
+
- Use continuous (float) position/velocity with tile-based collision.
|
|
67
|
+
- Provide a run modifier (Mario "B") to increase max speed by ~30-40%.
|
|
68
|
+
- Target metrics (tuned in Physics section):
|
|
69
|
+
- Walk speed: ~3 tiles/sec; run speed: ~4.2 tiles/sec.
|
|
70
|
+
- Jump apex time: ~0.35–0.45s; max height: ~3.5–4 tiles.
|
|
71
|
+
- Coyote time: ~100ms; jump buffer: ~120ms.
|
|
72
|
+
- Keep air control at ~60–70% of ground accel.
|
|
73
|
+
- Verification:
|
|
74
|
+
- Player can clear a 2-tile gap only while running.
|
|
75
|
+
- Tap jump yields visibly shorter arc than hold jump.
|
|
76
|
+
- Short hops are possible with quick jump release.
|
|
77
|
+
- Controls & Input
|
|
78
|
+
- Key mapping
|
|
79
|
+
- Design intent:
|
|
80
|
+
- Support intuitive controls for a terminal: arrows + WASD + vim.
|
|
81
|
+
- Provide a run modifier for Mario-like speed control.
|
|
82
|
+
- Keep pause/restart/quit accessible with one key.
|
|
83
|
+
- Implementation details:
|
|
84
|
+
- Movement: Left/Right = ←/→, A/D, H/L.
|
|
85
|
+
- Jump: Up/Space/W/K.
|
|
86
|
+
- Run modifier: Shift (if detectable) or Alt; fallback key `x` as run toggle/hold.
|
|
87
|
+
- Crouch/Down: ↓/S/J (used for pipes or future features).
|
|
88
|
+
- Pause: P. Restart: R. Quit: Q or Esc.
|
|
89
|
+
- Input handling via `matchesKey` and raw key strings; map to actions each tick.
|
|
90
|
+
- Verification:
|
|
91
|
+
- All listed keys move/jump in a visible, immediate way.
|
|
92
|
+
- Run modifier visibly increases max speed.
|
|
93
|
+
- Pause and quit work from any state.
|
|
94
|
+
- Input buffering
|
|
95
|
+
- Design intent:
|
|
96
|
+
- Make jumps feel responsive despite low tick rate.
|
|
97
|
+
- Reduce "I pressed jump but nothing happened" frustration.
|
|
98
|
+
- Implementation details:
|
|
99
|
+
- Jump buffer: store jump input for 120ms; if player becomes grounded within window, consume jump.
|
|
100
|
+
- Coyote time: allow jump for 100ms after leaving ground.
|
|
101
|
+
- Buffer only jump; movement uses current frame input.
|
|
102
|
+
- Clear buffer on successful jump or after timeout.
|
|
103
|
+
- Verification:
|
|
104
|
+
- Jump pressed slightly before landing still triggers a jump.
|
|
105
|
+
- Jump pressed slightly after leaving a ledge still triggers a jump.
|
|
106
|
+
- Pausing/quitting/restart
|
|
107
|
+
- Design intent:
|
|
108
|
+
- Make it safe to leave the game at any time without losing progress.
|
|
109
|
+
- Keep the command responsive while waiting for compaction.
|
|
110
|
+
- Implementation details:
|
|
111
|
+
- Pause toggled with P; pause freezes physics, timers, enemies.
|
|
112
|
+
- Quit with Q/Esc: save state and exit to terminal.
|
|
113
|
+
- Restart with R: clears save, resets level and stats to defaults.
|
|
114
|
+
- If game over, show prompt: `[R] Restart [Q] Quit`.
|
|
115
|
+
- If paused, show prompt: `[P] Resume [R] Restart [Q] Quit`.
|
|
116
|
+
- Verification:
|
|
117
|
+
- Pause stops all movement and time countdown.
|
|
118
|
+
- Quit + relaunch resumes at same spot (unless R used).
|
|
119
|
+
- Game Loop & States
|
|
120
|
+
- State machine
|
|
121
|
+
- Design intent:
|
|
122
|
+
- Make behavior deterministic and testable.
|
|
123
|
+
- Separate gameplay, pause, and terminal transitions.
|
|
124
|
+
- Implementation details:
|
|
125
|
+
- States: `boot`, `ready`, `playing`, `paused`, `dead`, `level_clear`, `game_over`, `exiting`.
|
|
126
|
+
- `boot`: load save, initialize level, render first frame.
|
|
127
|
+
- `ready`: show HUD + controls hint; waiting for first input (if resumed).
|
|
128
|
+
- `playing`: physics + timers + enemies active.
|
|
129
|
+
- `paused`: freeze simulation; allow resume/restart/quit.
|
|
130
|
+
- `dead`: death animation/timeout; then respawn or game over.
|
|
131
|
+
- `level_clear`: short celebration; then advance.
|
|
132
|
+
- `game_over`: no simulation; allow restart/quit.
|
|
133
|
+
- `exiting`: write save and exit UI.
|
|
134
|
+
- Verification:
|
|
135
|
+
- Only `playing` advances physics/time.
|
|
136
|
+
- `paused` and `game_over` ignore movement inputs.
|
|
137
|
+
- Transitions
|
|
138
|
+
- Design intent:
|
|
139
|
+
- Keep transitions predictable and responsive.
|
|
140
|
+
- Avoid hidden timers or ambiguous state changes.
|
|
141
|
+
- Implementation details:
|
|
142
|
+
- `boot` -> `ready` if saved game present; else -> `playing`.
|
|
143
|
+
- `ready` -> `playing` on first non-quit input.
|
|
144
|
+
- `playing` -> `paused` on P; `paused` -> `playing` on P.
|
|
145
|
+
- `playing` -> `dead` on fatal collision or timer=0.
|
|
146
|
+
- `dead` -> `playing` after respawn delay if lives remain; else -> `game_over`.
|
|
147
|
+
- `playing` -> `level_clear` on goal; `level_clear` -> `playing` after 1s or on input.
|
|
148
|
+
- `playing`/`paused`/`game_over` -> `exiting` on Q/Esc (save first).
|
|
149
|
+
- `game_over` -> `playing` on R (new run).
|
|
150
|
+
- Verification:
|
|
151
|
+
- Each transition has a single, documented trigger.
|
|
152
|
+
- Quit always saves before exit; restart always clears save.
|
|
153
|
+
- Level Design
|
|
154
|
+
- Tile palette
|
|
155
|
+
- Design intent:
|
|
156
|
+
- Keep a minimal, legible tile set that reads at low resolution.
|
|
157
|
+
- Separate solid, semi-solid, and decorative tiles clearly.
|
|
158
|
+
- Implementation details:
|
|
159
|
+
- Core tiles (solid unless noted):
|
|
160
|
+
- Ground (`#`), Brick (`B`), Question (`?`), Coin (`o`, non-solid),
|
|
161
|
+
- Pipe top (`T`), Pipe body (`P`), Flag/Goal (`G`),
|
|
162
|
+
- Spike (`^`, hazard), Water (`~`, hazard),
|
|
163
|
+
- Empty (` `), Spawn (`S`, editor-only).
|
|
164
|
+
- Each tile defines: `solid`, `hazard`, `collectible`, `interaction` flags.
|
|
165
|
+
- Question blocks spawn coins or mushroom (first-time hit).
|
|
166
|
+
- Pipes are solid; optional enter behavior when crouching.
|
|
167
|
+
- Verification:
|
|
168
|
+
- Solid tiles block movement; non-solid coins do not.
|
|
169
|
+
- Hazards trigger death on contact.
|
|
170
|
+
- Layout rules
|
|
171
|
+
- Design intent:
|
|
172
|
+
- Keep levels short and readable; avoid visual noise.
|
|
173
|
+
- Teach one concept at a time; introduce hazards in isolation first.
|
|
174
|
+
- Implementation details:
|
|
175
|
+
- Maintain a safe landing after every new gap or hazard.
|
|
176
|
+
- Max consecutive enemies: 2 (Level 1), 3 (later).
|
|
177
|
+
- Place coins to hint at optimal jumps or safe platforms.
|
|
178
|
+
- Pipes should be 2 tiles wide and at least 2 tiles tall.
|
|
179
|
+
- Minimum ceiling height for jumps: 4 tiles above ground.
|
|
180
|
+
- No blind drops: always show the landing area within camera view.
|
|
181
|
+
- Verification:
|
|
182
|
+
- Each gap in Level 1 has visible landing space.
|
|
183
|
+
- Coin lines align with intended jump arcs.
|
|
184
|
+
- Level 1 (short)
|
|
185
|
+
- Design intent:
|
|
186
|
+
- Deliver a satisfying "mini 1-1" in under ~90 seconds.
|
|
187
|
+
- Include all core interactions: move, jump, coin, enemy, block, goal.
|
|
188
|
+
- Implementation details:
|
|
189
|
+
- Length target: 3–4 screen widths.
|
|
190
|
+
- Segment 1 (0–1 screen): flat ground, 3-coin line, low brick step.
|
|
191
|
+
- Segment 2 (1–2 screens): 4-tile gap, single goomba, question block with coin.
|
|
192
|
+
- Segment 3 (2–3 screens): pipe (2 tiles wide), 2 goombas spaced, brick stack.
|
|
193
|
+
- Segment 4 (3–4 screens): 2-tile gap (requires run), staircase to flag.
|
|
194
|
+
- Midpoint checkpoint: after pipe in Segment 3.
|
|
195
|
+
- Goal: flag/goal post at far right on solid ground.
|
|
196
|
+
- Verification:
|
|
197
|
+
- A running jump is required for final 2-tile gap.
|
|
198
|
+
- Goal reachable within 60–90 seconds without deaths.
|
|
199
|
+
- Entities & Interactions
|
|
200
|
+
- Player
|
|
201
|
+
- Design intent:
|
|
202
|
+
- A clear, responsive avatar with distinct power states.
|
|
203
|
+
- Small/big states affect survivability and collisions.
|
|
204
|
+
- Implementation details:
|
|
205
|
+
- States: `small`, `big` (future: `fire`).
|
|
206
|
+
- Size: small = 1x2 tiles; big = 1x3 tiles (hitbox anchored at feet).
|
|
207
|
+
- Damage rules: small hit -> death; big hit -> shrink + invuln.
|
|
208
|
+
- Stomp: downward collision with enemy kills enemy and bounces player.
|
|
209
|
+
- Head-bump: hitting bricks/questions from below triggers interactions.
|
|
210
|
+
- Collect coins by overlap; pickups apply immediately.
|
|
211
|
+
- Verification:
|
|
212
|
+
- Big Mario fits under 3-tile ceilings; small fits under 2-tile ceilings.
|
|
213
|
+
- Stomp only works when falling onto enemy top.
|
|
214
|
+
- Blocks
|
|
215
|
+
- Design intent:
|
|
216
|
+
- Provide clear, satisfying interactions with the environment.
|
|
217
|
+
- Make blocks readable and deterministic.
|
|
218
|
+
- Implementation details:
|
|
219
|
+
- Bricks (`B`): solid; small Mario hits from below = no break; big Mario breaks brick.
|
|
220
|
+
- Question (`?`): first hit spawns coin or mushroom, then becomes "used" tile.
|
|
221
|
+
- Used block (`U`): solid, no further interactions.
|
|
222
|
+
- Pipes (`T`/`P`): solid; optional down-entry if player is crouching on top.
|
|
223
|
+
- Block hit effect: short vertical nudge + particle or text cue.
|
|
224
|
+
- Verification:
|
|
225
|
+
- Big Mario breaks brick; small Mario does not.
|
|
226
|
+
- Question block only yields one item then becomes used.
|
|
227
|
+
- Items
|
|
228
|
+
- Design intent:
|
|
229
|
+
- Keep item set minimal and meaningful.
|
|
230
|
+
- Each item changes play in a visible, immediate way.
|
|
231
|
+
- Implementation details:
|
|
232
|
+
- Coin: +1 coin, +100 score; disappears on pickup.
|
|
233
|
+
- Mushroom: sets player to `big`; if already big, +1000 score.
|
|
234
|
+
- (Optional) 1-up: +1 life; rare, only in hidden question block.
|
|
235
|
+
- Spawn rules: question blocks yield a coin by default; one mushroom per level.
|
|
236
|
+
- Item motion: mushroom slides along ground, reverses on walls, falls off edges.
|
|
237
|
+
- Verification:
|
|
238
|
+
- Coin count increases on pickup; UI updates.
|
|
239
|
+
- Mushroom collision changes player size immediately.
|
|
240
|
+
- Enemies
|
|
241
|
+
- Design intent:
|
|
242
|
+
- Start with a single, readable enemy type for reliability.
|
|
243
|
+
- Enemies enforce jump timing without clutter.
|
|
244
|
+
- Implementation details:
|
|
245
|
+
- Goomba only (Level 1+): patrols left/right, flips on wall hit.
|
|
246
|
+
- Speed: slow (approx 1 tile/sec); always grounded.
|
|
247
|
+
- Stomped goomba dies; side collision damages player.
|
|
248
|
+
- Goombas fall off edges in later levels; Level 1 uses ground.
|
|
249
|
+
- Verification:
|
|
250
|
+
- Stomp kills goomba and triggers bounce.
|
|
251
|
+
- Side collision kills small or shrinks big.
|
|
252
|
+
- Hazards
|
|
253
|
+
- Design intent:
|
|
254
|
+
- Provide clear, readable dangers with simple rules.
|
|
255
|
+
- Implementation details:
|
|
256
|
+
- Pits: falling below level bounds triggers death.
|
|
257
|
+
- Spikes (`^`): contact triggers death (no invuln bypass).
|
|
258
|
+
- Water (`~`): contact triggers death (no swim mechanic).
|
|
259
|
+
- Hazards are static tiles, not moving entities.
|
|
260
|
+
- Verification:
|
|
261
|
+
- Falling off-screen kills player within 0.5s.
|
|
262
|
+
- Touching spikes/water kills regardless of power state.
|
|
263
|
+
- Physics & Movement
|
|
264
|
+
- Gravity / accel / friction
|
|
265
|
+
- Design intent:
|
|
266
|
+
- Snappy ground control with manageable momentum.
|
|
267
|
+
- Air control present but reduced.
|
|
268
|
+
- Implementation details:
|
|
269
|
+
- Units: tiles/sec for target speeds; update in fixed timestep.
|
|
270
|
+
- Gravity: 20–24 tiles/sec^2; max fall speed 8–10 tiles/sec.
|
|
271
|
+
- Ground accel: 30–40 tiles/sec^2; ground decel (friction) 25–35 tiles/sec^2.
|
|
272
|
+
- Air accel: 60–70% of ground accel; air decel minimal.
|
|
273
|
+
- Walk max speed: 3 tiles/sec; Run max speed: 4.2 tiles/sec (when run modifier held).
|
|
274
|
+
- Verification:
|
|
275
|
+
- Player reaches walk speed in ~0.2–0.3s, run speed in ~0.35–0.45s.
|
|
276
|
+
- Letting go of input stops within ~0.25–0.35s on ground.
|
|
277
|
+
- Jump (variable)
|
|
278
|
+
- Design intent:
|
|
279
|
+
- Support short hops and full jumps for precise control.
|
|
280
|
+
- Jump feel should be forgiving but not floaty.
|
|
281
|
+
- Implementation details:
|
|
282
|
+
- Initial jump velocity tuned for 3.5–4 tile apex.
|
|
283
|
+
- If jump released early (within 150ms), apply extra gravity multiplier (e.g., 1.8x).
|
|
284
|
+
- Use coyote time (100ms) and jump buffer (120ms) from input section.
|
|
285
|
+
- Disallow jump while in `dead`/`level_clear`/`game_over`.
|
|
286
|
+
- Verification:
|
|
287
|
+
- Tap jump yields ~2–2.5 tile height.
|
|
288
|
+
- Hold jump yields ~3.5–4 tile height.
|
|
289
|
+
- Coyote and buffered jumps trigger reliably.
|
|
290
|
+
- Collision resolution
|
|
291
|
+
- Design intent:
|
|
292
|
+
- Keep collisions predictable and stable at low resolution.
|
|
293
|
+
- Implementation details:
|
|
294
|
+
- Separate horizontal and vertical movement steps each tick.
|
|
295
|
+
- Resolve vertical first for stomp logic: check downwards collision with enemy top.
|
|
296
|
+
- Tile collision: clamp position to tile boundary; zero relevant velocity.
|
|
297
|
+
- Entity collision: AABB overlap; prioritize stomp if vy > 0 and player bottom above enemy midline.
|
|
298
|
+
- Head-bump: if vy < 0 and tile above is solid, stop upward velocity and trigger block interaction.
|
|
299
|
+
- Prevent tunneling: limit max velocity or use sub-steps when speed > tile size per tick.
|
|
300
|
+
- Verification:
|
|
301
|
+
- No "sticking" on tile edges while running.
|
|
302
|
+
- Stomps consistently trigger when falling onto enemy.
|
|
303
|
+
|
|
304
|
+
- Presentation
|
|
305
|
+
- Camera & Viewport
|
|
306
|
+
- Target size
|
|
307
|
+
- Design intent:
|
|
308
|
+
- Provide a consistent playfield that fits common terminals.
|
|
309
|
+
- Keep characters readable without scrolling UI.
|
|
310
|
+
- Implementation details:
|
|
311
|
+
- Target viewport: 40 cols x 15 rows of tiles (game area).
|
|
312
|
+
- HUD/header uses 2–3 lines above viewport.
|
|
313
|
+
- Require minimum terminal width: 60 cols; height: 22 rows.
|
|
314
|
+
- If terminal smaller: show warning and instructions to resize.
|
|
315
|
+
- Verification:
|
|
316
|
+
- At 80x24 terminal, game renders without wrapping.
|
|
317
|
+
- Resize below minimum shows "Terminal too small" message.
|
|
318
|
+
- Scroll rules
|
|
319
|
+
- Design intent:
|
|
320
|
+
- Keep the player visible with minimal camera jitter.
|
|
321
|
+
- Allow small backtracking but prevent large reverse scrolling.
|
|
322
|
+
- Implementation details:
|
|
323
|
+
- Camera follows player earlier: keep player near 25% of viewport width.
|
|
324
|
+
- Only scroll forward by default; allow 10–15% backtracking within current screen.
|
|
325
|
+
- Vertical camera locked (no vertical scrolling) to simplify rendering.
|
|
326
|
+
- Camera clamps to level bounds; never shows beyond level edges.
|
|
327
|
+
- Verification:
|
|
328
|
+
- Player stays within view during jumps and runs.
|
|
329
|
+
- Camera does not oscillate when player pauses.
|
|
330
|
+
- Bounds/edges
|
|
331
|
+
- Design intent:
|
|
332
|
+
- Prevent camera from exposing empty space outside the level.
|
|
333
|
+
- Keep player collision consistent near edges.
|
|
334
|
+
- Implementation details:
|
|
335
|
+
- Camera clamps X between 0 and (levelWidth - viewportWidth).
|
|
336
|
+
- Left edge: player cannot move beyond x=0.
|
|
337
|
+
- Right edge: allow player to reach goal even if camera stops.
|
|
338
|
+
- Bottom: falling below level height triggers death.
|
|
339
|
+
- Verification:
|
|
340
|
+
- No blank columns appear beyond level edges.
|
|
341
|
+
- Player cannot walk left of level start.
|
|
342
|
+
- Rendering & Palette
|
|
343
|
+
- 256-color plan
|
|
344
|
+
- Design intent:
|
|
345
|
+
- Use a small, consistent ANSI 256-color palette to keep tiles readable.
|
|
346
|
+
- Avoid Unicode width issues; prioritize ASCII + color.
|
|
347
|
+
- Implementation details:
|
|
348
|
+
- Define palette indices for: sky, ground, grass, brick, coin, player, enemy, hazard, pipe, goal, text.
|
|
349
|
+
- Use a single foreground color per tile glyph; background optional for sky gradient.
|
|
350
|
+
- Default glyph width: 2 chars per tile to preserve aspect ratio.
|
|
351
|
+
- Provide a palette map in code (e.g., array of ANSI color IDs).
|
|
352
|
+
- Verification:
|
|
353
|
+
- All tiles render with distinct colors on dark backgrounds.
|
|
354
|
+
- No layout jitter from multi-width glyphs.
|
|
355
|
+
- Glyphs / tiles
|
|
356
|
+
- Design intent:
|
|
357
|
+
- Keep glyphs simple, ASCII, and 2-char wide per tile.
|
|
358
|
+
- Implementation details:
|
|
359
|
+
- Recommended glyphs (2 chars):
|
|
360
|
+
- Ground: "##"; Brick: "[]"; Question: "??"; Used: "..";
|
|
361
|
+
- Coin: "o "; Pipe top/body: "||"; Flag/Goal: "|>";
|
|
362
|
+
- Spike: "/\\"; Water: "~~"; Empty: " ".
|
|
363
|
+
- Player: small "<>" body; big uses "<>", "[]" stack (1x3 tiles, 2-char wide).
|
|
364
|
+
- Enemy (goomba): "GG".
|
|
365
|
+
- All glyphs must be ASCII; avoid Unicode blocks.
|
|
366
|
+
- Verification:
|
|
367
|
+
- All tiles align to a 2-char grid with no drift.
|
|
368
|
+
- Player/enemy sprites stay within their tile bounds.
|
|
369
|
+
- HUD & Scoring
|
|
370
|
+
- HUD layout
|
|
371
|
+
- Design intent:
|
|
372
|
+
- Keep HUD compact and readable without stealing play space.
|
|
373
|
+
- Implementation details:
|
|
374
|
+
- HUD on 2 lines above viewport.
|
|
375
|
+
- Line 1: title + level + time. Line 2: score + coins + lives.
|
|
376
|
+
- Use color accents for warnings (time low, low lives).
|
|
377
|
+
- Show brief state messages (PAUSED, GAME OVER) centered.
|
|
378
|
+
- Verification:
|
|
379
|
+
- HUD never overlaps game area.
|
|
380
|
+
- Time warning triggers at <= 30 seconds.
|
|
381
|
+
- Score/lives/time/coins
|
|
382
|
+
- Design intent:
|
|
383
|
+
- Provide simple feedback loops: coins and score for actions, lives for risk.
|
|
384
|
+
- Implementation details:
|
|
385
|
+
- Score: +100 coin, +50 stomp, +10 brick break, +500 level clear bonus.
|
|
386
|
+
- Coins: display count; at 100 coins grant +1 life (optional).
|
|
387
|
+
- Lives: start at 3; display hearts or "x3".
|
|
388
|
+
- Time: start at 300; decrement every second in playing state.
|
|
389
|
+
- Verification:
|
|
390
|
+
- HUD updates instantly on score/coin changes.
|
|
391
|
+
- Time stops when paused.
|
|
392
|
+
- FX & Feedback (optional)
|
|
393
|
+
- Particles
|
|
394
|
+
- Design intent:
|
|
395
|
+
- Add small feedback bursts without heavy rendering cost.
|
|
396
|
+
- Implementation details:
|
|
397
|
+
- Spawn 4–8 particles on: brick break, enemy stomp, coin pickup.
|
|
398
|
+
- Particles are short-lived colored dots (1–2 chars), 200–400ms.
|
|
399
|
+
- Cap total particles to avoid slowdown (e.g., max 40).
|
|
400
|
+
- Verification:
|
|
401
|
+
- Particle count never exceeds cap.
|
|
402
|
+
- Particles do not affect collision or input.
|
|
403
|
+
- Text cues
|
|
404
|
+
- Design intent:
|
|
405
|
+
- Provide immediate state feedback without extra graphics.
|
|
406
|
+
- Implementation details:
|
|
407
|
+
- Short overlays: "PAUSED", "LEVEL CLEAR", "GAME OVER", "1-UP".
|
|
408
|
+
- Display for 0.5–1.0s or until input.
|
|
409
|
+
- Use dim/bright color to distinguish from HUD.
|
|
410
|
+
- Verification:
|
|
411
|
+
- Cues appear on state change and disappear on resume.
|
|
412
|
+
|
|
413
|
+
- Tech + Delivery
|
|
414
|
+
- Save/Resume
|
|
415
|
+
- Autosave cadence
|
|
416
|
+
- Design intent:
|
|
417
|
+
- Preserve progress without manual saves.
|
|
418
|
+
- Avoid saving in unstable states (mid-death, mid-transition).
|
|
419
|
+
- Implementation details:
|
|
420
|
+
- Autosave on: pause, quit, level clear, and every 5–10 seconds during play.
|
|
421
|
+
- Do not autosave during `dead` animation or `game_over`.
|
|
422
|
+
- Save after physics step to ensure consistent state.
|
|
423
|
+
- Verification:
|
|
424
|
+
- Quitting always resumes at last autosave point.
|
|
425
|
+
- No saves are written during death animation.
|
|
426
|
+
- Persisted fields
|
|
427
|
+
- Design intent:
|
|
428
|
+
- Resume with minimal surprise; preserve meaningful progress.
|
|
429
|
+
- Implementation details:
|
|
430
|
+
- Persist: level index, player position/velocity, power state, coins, score, lives, time, checkpoint, RNG seed.
|
|
431
|
+
- Persist world state: used blocks, removed bricks, collected coins, enemy alive flags.
|
|
432
|
+
- Do not persist transient particles or text cues.
|
|
433
|
+
- Verification:
|
|
434
|
+
- After reload, used blocks remain used and coins stay collected.
|
|
435
|
+
- Player resumes with same power state and score.
|
|
436
|
+
- Resume behavior
|
|
437
|
+
- Design intent:
|
|
438
|
+
- Resume should feel immediate but safe (no surprise hazards).
|
|
439
|
+
- Implementation details:
|
|
440
|
+
- On resume, load saved state and start in `ready` (paused) with hint "Press any key".
|
|
441
|
+
- Give 0.5s invulnerability on resume to prevent instant death.
|
|
442
|
+
- If saved during pause, resume stays paused until input.
|
|
443
|
+
- If no save, start new run at Level 1 start.
|
|
444
|
+
- Verification:
|
|
445
|
+
- Resume does not move player until input.
|
|
446
|
+
- Immediate hazards do not kill player during invuln window.
|
|
447
|
+
- Technical Architecture
|
|
448
|
+
- Data model
|
|
449
|
+
- Design intent:
|
|
450
|
+
- Keep state structured and serializable for save/resume.
|
|
451
|
+
- Implementation details:
|
|
452
|
+
- `GameState`: levelIndex, time, score, coins, lives, rngSeed, state, cameraX.
|
|
453
|
+
- `PlayerState`: x, y, vx, vy, facing, power, onGround, invulnTimer.
|
|
454
|
+
- `LevelState`: tiles[][], width, height, usedBlocks set, collectedCoins set.
|
|
455
|
+
- `EnemyState[]`: type, x, y, vx, vy, alive.
|
|
456
|
+
- `ItemState[]`: type, x, y, vx, vy, active.
|
|
457
|
+
- `SaveState`: snapshot of GameState + PlayerState + LevelState + entities.
|
|
458
|
+
- Verification:
|
|
459
|
+
- SaveState can be JSON-serialized without custom classes.
|
|
460
|
+
- Update order
|
|
461
|
+
- Design intent:
|
|
462
|
+
- Ensure deterministic behavior per tick.
|
|
463
|
+
- Implementation details:
|
|
464
|
+
- Per tick: handle input -> update player physics -> resolve tile collisions -> update enemies -> resolve entity collisions -> update items -> update camera -> render.
|
|
465
|
+
- Timers (time, invuln, animation) update only in playing state.
|
|
466
|
+
- Save hook runs after physics/collision step.
|
|
467
|
+
- Verification:
|
|
468
|
+
- Stomp logic runs after player movement but before enemy AI for the next frame.
|
|
469
|
+
- Collision handling
|
|
470
|
+
- Design intent:
|
|
471
|
+
- Separate tile vs entity collisions for clarity and testability.
|
|
472
|
+
- Implementation details:
|
|
473
|
+
- Tile collisions handled via grid probe (corners) per axis.
|
|
474
|
+
- Entity collisions via AABB overlap after movement.
|
|
475
|
+
- Priority: resolve tiles first, then entities (stomp/side hit), then items.
|
|
476
|
+
- Use discrete tile size; clamp positions on impact.
|
|
477
|
+
- Verification:
|
|
478
|
+
- Player never passes through solid tiles at max speed.
|
|
479
|
+
- Stomp and side-hit outcomes are consistent.
|
|
480
|
+
- Input handling
|
|
481
|
+
- Design intent:
|
|
482
|
+
- Translate raw keypresses into stable per-tick actions.
|
|
483
|
+
- Implementation details:
|
|
484
|
+
- Use `handleInput(data)` to set intent flags (left/right/jump/run).
|
|
485
|
+
- Clear intents after a short timeout (e.g., 100–150ms) to simulate keyup.
|
|
486
|
+
- Input buffering: store last jump press timestamp for buffer/coyote.
|
|
487
|
+
- Ignore movement inputs in non-playing states (except ready/unpause).
|
|
488
|
+
- Verification:
|
|
489
|
+
- Holding key results in continuous movement via repeated key events.
|
|
490
|
+
- Jump buffer triggers within specified window.
|
|
491
|
+
- Serialization
|
|
492
|
+
- Design intent:
|
|
493
|
+
- Keep save format stable and forward-compatible.
|
|
494
|
+
- Implementation details:
|
|
495
|
+
- Save as JSON via session entries; include version field.
|
|
496
|
+
- On load, migrate older versions with defaults.
|
|
497
|
+
- Validate required fields; if invalid, discard save.
|
|
498
|
+
- Verification:
|
|
499
|
+
- Old save versions load with reasonable defaults.
|
|
500
|
+
- Corrupt save is ignored without crashing.
|
|
501
|
+
- Feature Stories & Sequencing
|
|
502
|
+
- Design intent:
|
|
503
|
+
- Enable incremental delivery with playable checkpoints.
|
|
504
|
+
- Implementation details:
|
|
505
|
+
- Story 1: Core loop (movement, gravity, tiles, Level 1 layout).
|
|
506
|
+
- Story 2: Enemies + stomp + hazards.
|
|
507
|
+
- Story 3: Blocks + coins + scoring + HUD.
|
|
508
|
+
- Story 4: Power-ups (mushroom) + big state.
|
|
509
|
+
- Story 5: Save/resume + pause/quit.
|
|
510
|
+
- Story 6: Polish (particles, text cues, camera dead-zone).
|
|
511
|
+
- Each story has a playable demo gate.
|
|
512
|
+
- Verification:
|
|
513
|
+
- Each story can be validated independently in TUI.
|
|
514
|
+
- Test Plan
|
|
515
|
+
- Design intent:
|
|
516
|
+
- Validate core mechanics quickly in a terminal.
|
|
517
|
+
- Implementation details:
|
|
518
|
+
- Manual checks:
|
|
519
|
+
- Movement/jump feel (walk/run, short/long jumps).
|
|
520
|
+
- Stomp enemy vs side collision outcomes.
|
|
521
|
+
- Block interactions (brick break, question use).
|
|
522
|
+
- Save/resume: quit and resume at same spot.
|
|
523
|
+
- Camera: dead-zone, no overscroll.
|
|
524
|
+
- Automated checks (optional):
|
|
525
|
+
- Simulate physics step for jump apex height.
|
|
526
|
+
- Serialize/deserialize SaveState and compare fields.
|
|
527
|
+
- Verification:
|
|
528
|
+
- All manual checks pass in under 5 minutes.
|
|
529
|
+
- Milestones
|
|
530
|
+
- Design intent:
|
|
531
|
+
- Provide checkpoints for incremental shipping.
|
|
532
|
+
- Implementation details:
|
|
533
|
+
- M1: Basic Level 1 playable (movement, tiles, camera).
|
|
534
|
+
- M2: Enemies + hazards + scoring.
|
|
535
|
+
- M3: Blocks + items + power-ups.
|
|
536
|
+
- M4: Save/resume + polish (FX, cues).
|
|
537
|
+
- Verification:
|
|
538
|
+
- Each milestone yields a playable build.
|
|
539
|
+
- Open Questions
|
|
540
|
+
- Design intent:
|
|
541
|
+
- Track decisions that affect feel or scope.
|
|
542
|
+
- Implementation details:
|
|
543
|
+
- Finalize run modifier key (Shift vs X fallback).
|
|
544
|
+
- Decide if pipe entry is implemented in v1.
|
|
545
|
+
- Confirm scoring values and time limit.
|
|
546
|
+
- Determine if coins grant extra life at 100.
|
|
547
|
+
- Verification:
|
|
548
|
+
- Open questions resolved before M3.
|