docs(03-04): complete reward screen and game loop plan
- SUMMARY.md for reward module and game flow wiring - STATE.md updated with position, decisions, metrics - ROADMAP.md updated with plan progress - Requirements RWRD-01 through RWRD-04 marked complete
This commit is contained in:
@@ -82,10 +82,10 @@ Requirements for initial release (MVP). Each maps to roadmap phases.
|
|||||||
|
|
||||||
### Reward
|
### Reward
|
||||||
|
|
||||||
- [ ] **RWRD-01**: Belohnungs-Screen nach jeder Einheit: Neues Waldelement-Bild + Companion-Kommentar
|
- [x] **RWRD-01**: Belohnungs-Screen nach jeder Einheit: Neues Waldelement-Bild + Companion-Kommentar
|
||||||
- [ ] **RWRD-02**: Pre-Generation: Bild wird während Übung im Hintergrund generiert
|
- [x] **RWRD-02**: Pre-Generation: Bild wird während Übung im Hintergrund generiert
|
||||||
- [ ] **RWRD-03**: Placeholder bei Wartezeit ("Der Wald denkt nach..." mit animierten Blättern)
|
- [x] **RWRD-03**: Placeholder bei Wartezeit ("Der Wald denkt nach..." mit animierten Blättern)
|
||||||
- [ ] **RWRD-04**: "Weiter üben" / "Zurück zum Wald" Buttons
|
- [x] **RWRD-04**: "Weiter üben" / "Zurück zum Wald" Buttons
|
||||||
|
|
||||||
### Parent Area
|
### Parent Area
|
||||||
|
|
||||||
@@ -196,10 +196,10 @@ Which phases cover which requirements. Updated during roadmap creation.
|
|||||||
| FRST-01 | Phase 3 | Complete |
|
| FRST-01 | Phase 3 | Complete |
|
||||||
| FRST-02 | Phase 3 | Complete |
|
| FRST-02 | Phase 3 | Complete |
|
||||||
| FRST-03 | Phase 3 | Complete |
|
| FRST-03 | Phase 3 | Complete |
|
||||||
| RWRD-01 | Phase 3 | Pending |
|
| RWRD-01 | Phase 3 | Complete |
|
||||||
| RWRD-02 | Phase 3 | Pending |
|
| RWRD-02 | Phase 3 | Complete |
|
||||||
| RWRD-03 | Phase 3 | Pending |
|
| RWRD-03 | Phase 3 | Complete |
|
||||||
| RWRD-04 | Phase 3 | Pending |
|
| RWRD-04 | Phase 3 | Complete |
|
||||||
| PRNT-01 | Phase 3 | Complete |
|
| PRNT-01 | Phase 3 | Complete |
|
||||||
| PRNT-02 | Phase 3 | Complete |
|
| PRNT-02 | Phase 3 | Complete |
|
||||||
| PRNT-03 | Phase 3 | Complete |
|
| PRNT-03 | Phase 3 | Complete |
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ Plans:
|
|||||||
- [x] 03-01-PLAN.md — Word lists per level, Progress type extension, rate limit update
|
- [x] 03-01-PLAN.md — Word lists per level, Progress type extension, rate limit update
|
||||||
- [x] 03-02-PLAN.md — Lesson 3-phase state machine (discover/practice/words), review + repetition logic
|
- [x] 03-02-PLAN.md — Lesson 3-phase state machine (discover/practice/words), review + repetition logic
|
||||||
- [x] 03-03-PLAN.md — Forest visual scene (SVG background, 4x3 grid, element rendering from IndexedDB)
|
- [x] 03-03-PLAN.md — Forest visual scene (SVG background, 4x3 grid, element rendering from IndexedDB)
|
||||||
- [ ] 03-04-PLAN.md — Reward screen with pre-generation, full flow wiring (lesson -> reward -> forest)
|
- [x] 03-04-PLAN.md — Reward screen with pre-generation, full flow wiring (lesson -> reward -> forest)
|
||||||
- [x] 03-05-PLAN.md — Parent area (access gate, stats overview, settings panel)
|
- [x] 03-05-PLAN.md — Parent area (access gate, stats overview, settings panel)
|
||||||
|
|
||||||
**UI hint**: yes
|
**UI hint**: yes
|
||||||
|
|||||||
+11
-8
@@ -2,15 +2,15 @@
|
|||||||
gsd_state_version: 1.0
|
gsd_state_version: 1.0
|
||||||
milestone: v1.0
|
milestone: v1.0
|
||||||
milestone_name: milestone
|
milestone_name: milestone
|
||||||
status: executing
|
status: verifying
|
||||||
stopped_at: Completed 03-02-PLAN.md
|
stopped_at: Completed 03-04-PLAN.md
|
||||||
last_updated: "2026-03-29T11:49:51.101Z"
|
last_updated: "2026-03-29T11:54:23.974Z"
|
||||||
last_activity: 2026-03-29
|
last_activity: 2026-03-29
|
||||||
progress:
|
progress:
|
||||||
total_phases: 4
|
total_phases: 4
|
||||||
completed_phases: 2
|
completed_phases: 3
|
||||||
total_plans: 15
|
total_plans: 15
|
||||||
completed_plans: 14
|
completed_plans: 15
|
||||||
percent: 0
|
percent: 0
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ See: .planning/PROJECT.md (updated 2026-03-29)
|
|||||||
|
|
||||||
Phase: 03 (komplettes-spielerlebnis) — EXECUTING
|
Phase: 03 (komplettes-spielerlebnis) — EXECUTING
|
||||||
Plan: 5 of 5
|
Plan: 5 of 5
|
||||||
Status: Ready to execute
|
Status: Phase complete — ready for verification
|
||||||
Last activity: 2026-03-29
|
Last activity: 2026-03-29
|
||||||
|
|
||||||
Progress: [░░░░░░░░░░] 0%
|
Progress: [░░░░░░░░░░] 0%
|
||||||
@@ -66,6 +66,7 @@ Progress: [░░░░░░░░░░] 0%
|
|||||||
| Phase 03 P01 | 3min | 2 tasks | 7 files |
|
| Phase 03 P01 | 3min | 2 tasks | 7 files |
|
||||||
| Phase 03 P05 | 2min | 2 tasks | 4 files |
|
| Phase 03 P05 | 2min | 2 tasks | 4 files |
|
||||||
| Phase 03 P02 | 4min | 2 tasks | 6 files |
|
| Phase 03 P02 | 4min | 2 tasks | 6 files |
|
||||||
|
| Phase 03 P04 | 3min | 2 tasks | 4 files |
|
||||||
|
|
||||||
## Accumulated Context
|
## Accumulated Context
|
||||||
|
|
||||||
@@ -98,6 +99,8 @@ Recent decisions affecting current work:
|
|||||||
- [Phase 03]: Access code hardcoded as 1234 for single-user private app
|
- [Phase 03]: Access code hardcoded as 1234 for single-user private app
|
||||||
- [Phase 03]: Word mode uses intervalMs=0 (no timing pressure for word display)
|
- [Phase 03]: Word mode uses intervalMs=0 (no timing pressure for word display)
|
||||||
- [Phase 03]: Discover phase skips space key; review pulls 2 words from each of last 2-3 levels
|
- [Phase 03]: Discover phase skips space key; review pulls 2 words from each of last 2-3 levels
|
||||||
|
- [Phase 03]: Pre-generation uses fire-and-forget pattern: startPreGeneration() at lesson start, awaited on reward screen
|
||||||
|
- [Phase 03]: Progress migration function ensures backward compat with older IndexedDB data
|
||||||
|
|
||||||
### Pending Todos
|
### Pending Todos
|
||||||
|
|
||||||
@@ -109,6 +112,6 @@ None yet.
|
|||||||
|
|
||||||
## Session Continuity
|
## Session Continuity
|
||||||
|
|
||||||
Last session: 2026-03-29T11:49:51.094Z
|
Last session: 2026-03-29T11:54:23.968Z
|
||||||
Stopped at: Completed 03-02-PLAN.md
|
Stopped at: Completed 03-04-PLAN.md
|
||||||
Resume file: None
|
Resume file: None
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
---
|
||||||
|
phase: 03-komplettes-spielerlebnis
|
||||||
|
plan: 04
|
||||||
|
subsystem: game-flow
|
||||||
|
tags: [reward, pre-generation, gemini-image, indexeddb, game-loop]
|
||||||
|
|
||||||
|
requires:
|
||||||
|
- phase: 03-01
|
||||||
|
provides: Progress types with stats fields, level system
|
||||||
|
- phase: 03-02
|
||||||
|
provides: Lesson screen with 3-phase flow and stats callback
|
||||||
|
- phase: 03-03
|
||||||
|
provides: Forest scene rendering with element grid and animation
|
||||||
|
provides:
|
||||||
|
- Reward module with image pre-generation and display
|
||||||
|
- Complete game loop: forest -> lesson -> reward -> forest
|
||||||
|
- Review mechanic (every 3rd session)
|
||||||
|
- Repetition protection with encouragement
|
||||||
|
- Stats accumulation in Progress
|
||||||
|
affects: [03-05-parent-area]
|
||||||
|
|
||||||
|
tech-stack:
|
||||||
|
added: []
|
||||||
|
patterns: [pre-generation-pattern, fire-and-forget-async, progress-migration]
|
||||||
|
|
||||||
|
key-files:
|
||||||
|
created:
|
||||||
|
- src/forest/reward.ts
|
||||||
|
modified:
|
||||||
|
- src/app.ts
|
||||||
|
- index.html
|
||||||
|
- src/styles/main.css
|
||||||
|
|
||||||
|
key-decisions:
|
||||||
|
- "Pre-generation uses fire-and-forget pattern: startPreGeneration() called at lesson start, awaited on reward screen"
|
||||||
|
- "Fallback images loaded from existing SVGs in src/assets/fallback-images/ when rate-limited"
|
||||||
|
- "Progress migration function ensures backward compatibility with older saved data"
|
||||||
|
|
||||||
|
patterns-established:
|
||||||
|
- "Pre-generation pattern: start async work early, await result when needed, with fallback"
|
||||||
|
- "Progress migration: migrateProgress() ensures all fields exist before use"
|
||||||
|
|
||||||
|
requirements-completed: [RWRD-01, RWRD-02, RWRD-03, RWRD-04, TYPE-07]
|
||||||
|
|
||||||
|
duration: 3min
|
||||||
|
completed: 2026-03-29
|
||||||
|
---
|
||||||
|
|
||||||
|
# Phase 03 Plan 04: Reward Screen & Game Loop Summary
|
||||||
|
|
||||||
|
**Reward screen with pre-generated forest element images, companion comments, and complete game loop wiring (forest -> lesson -> reward -> forest)**
|
||||||
|
|
||||||
|
## Performance
|
||||||
|
|
||||||
|
- **Duration:** 3 min
|
||||||
|
- **Started:** 2026-03-29T11:50:31Z
|
||||||
|
- **Completed:** 2026-03-29T11:53:36Z
|
||||||
|
- **Tasks:** 2
|
||||||
|
- **Files modified:** 4
|
||||||
|
|
||||||
|
## Accomplishments
|
||||||
|
- Complete game loop: lesson completion shows reward screen with generated/fallback image and companion comment
|
||||||
|
- Image pre-generation starts at lesson begin, placeholder with animated leaves shown while loading
|
||||||
|
- Review mode triggers every 3rd session, encouragement after 2x same level
|
||||||
|
- Exercise stats (correct, errors, errorKeys) accumulated in Progress across sessions
|
||||||
|
|
||||||
|
## Task Commits
|
||||||
|
|
||||||
|
Each task was committed atomically:
|
||||||
|
|
||||||
|
1. **Task 1: Reward module with pre-generation and reward screen** - `e599050` (feat)
|
||||||
|
2. **Task 2: Wire complete flow in app.ts with review/repeat triggers** - `aaf9872` (feat)
|
||||||
|
|
||||||
|
## Files Created/Modified
|
||||||
|
- `src/forest/reward.ts` - Reward module: startPreGeneration(), initRewardScreen(), fallback image handling
|
||||||
|
- `src/app.ts` - Updated game flow: lesson -> reward -> forest, review triggers, stats accumulation, progress migration
|
||||||
|
- `index.html` - Reward screen HTML with image area, companion comment, action buttons
|
||||||
|
- `src/styles/main.css` - Reward screen CSS with placeholder animation, image appear animation, button styles
|
||||||
|
|
||||||
|
## Decisions Made
|
||||||
|
- Pre-generation uses fire-and-forget pattern at lesson start, awaited on reward screen with placeholder
|
||||||
|
- Fallback images loaded from existing static SVGs when rate-limited or API unavailable
|
||||||
|
- Progress migration function (migrateProgress) ensures backward compatibility with older IndexedDB data
|
||||||
|
- Grid position for new elements uses modulo 12 with random offset for natural placement
|
||||||
|
|
||||||
|
## Deviations from Plan
|
||||||
|
|
||||||
|
None - plan executed exactly as written.
|
||||||
|
|
||||||
|
## Issues Encountered
|
||||||
|
None
|
||||||
|
|
||||||
|
## User Setup Required
|
||||||
|
None - no external service configuration required.
|
||||||
|
|
||||||
|
## Known Stubs
|
||||||
|
None - all data paths are wired to real sources.
|
||||||
|
|
||||||
|
## Next Phase Readiness
|
||||||
|
- Game loop complete: forest -> lesson (3 phases) -> reward -> forest
|
||||||
|
- Ready for Plan 05 (parent area already has Ctrl+Shift+E shortcut wired from prior plan)
|
||||||
|
|
||||||
|
---
|
||||||
|
*Phase: 03-komplettes-spielerlebnis*
|
||||||
|
*Completed: 2026-03-29*
|
||||||
Reference in New Issue
Block a user