Repository navigation
Cutscene test plan
# 1. Scope
-
Content section: cutscene1 (5 scenes), cutscene2 (6), cutscene3 (5), cutscene4 (5), cutscene5 (6 incl. scene6)
-
Framework section: CutsceneLoader, CutsceneDefinition/CutsceneScene, CutsceneScreen state machine, CutsceneInputComponent, CutsceneCommand + terminal wiring, GdxGame.startCutscene/transitionTo, externally-controlled TextBoxComponent, music + resource lifecycle.
# 2. Automated tests
./gradlew :core:test --tests "com.csse3200.game.cutscene.*"
--tests "com.csse3200.game.screens.CutsceneScreenTest"
--tests "com.csse3200.game.ui.terminal.commands.CutsceneCommandTest"
--tests "com.csse3200.game.ui.terminal.TerminalTest"
--tests "com.csse3200.game.input.CutsceneInputComponentTest"
## 2A. Content - Every Cutscene
| # | Case | Expected |
|---|---|---|
| C1 |
load("cutscene1") … load("cutscene5")
|
success; scene counts 5/6/5/5/6; every manifest image exists on disk |
| C2 | Manifest ↔ files audit per cutscene | no missing JPEGs; flag orphans (e.g. confirm cutscene5/scene6.jpeg is referenced) |
| C3 |
cutscene cutscene1 … cutscene cutscene5
|
each returns true and fires startCutscene with the terminal's destination |
| C4 | Full playthrough per cutscene (large-delta render(), existing CutsceneScreenTest pattern) |
all scenes → fade-to-black → destination, music stopped, resources disposed |
## 2B. Framework
| # | Target | Cases |
|---|---|---|
| F1 |
CutsceneLoader validation |
rejects blank, /, .., \, :-style names; missing dir → error; scene without image → error; non-JPEG/missing image → error; empty scenes → error; fadeDuration <= 0 defaults to 0.4; missing config.json falls back to alphabetical JPEGs (test-no-manifest) |
| F2 |
CutsceneScreen states |
FADE_IN → TEXT_ACTIVE → advance() → FADE_TEXT → FADE_TO_NEXT / FADE_TO_BLACK → transitionTo(destination); COMPLETE renders nothing; mid-fade advances ignored |
| F3 | Skip path |
skipCutscene() from any state → exactly one transition, music stopped, inputs disposed; repeat call is a no-op |
| F4 | CutsceneInputComponent |
TAB advances; priority 100 < stage 200 so skip-button clicks don't also advance; touchUp advances |
| F5 | CutsceneCommand |
wrong arg count → false; unknown name → false + log; valid name → one startCutscene call |
| F6 | Terminal wiring |
cutscene registered in Terminal(game, destination); destination matches constructor arg |
| F7 | GdxGame.startCutscene |
disposes current screen, mounts CutsceneScreen with loaded cutscene + destination |
| F8 | TextBox integration | box is externallyControlled (TAB never dismisses); REVEALED_PAGE → NEXT_PAGE → DISMISSED honored; fade-out via setOpacity, then dismiss()
|
| F9 | Music | manifest track loops quietly; blank music → silent, no crash; stopped on skip, natural end, and dispose()
|
| F10 | Resources | scene + skip textures loaded in constructor, released in dispose(); ServiceLocator.clear() called; double-dispose() safe |
# 3. Manual checks (F1 → cutscene cutscene, N = 1–5)
- Each scene: correct image + text + music; typewriter finishes; TAB/click advances exactly once.
- Skip from first scene and mid-text → destination immediately, music stops, no double transition.
- TAB mash during fades → no skipped scenes, no stuck fade.
- cutscene badname / bare cutscene → terminal stays open, game unaffected.
- Level 1→2→3 playthrough → no cutscene fires unprompted.
- Content sign-off per cutscene; cutscene5 "..." placeholders — confirm if blocking.
# 4. Pass criteria
- C1–C4 pass for all five cutscenes; F1–F10 pass
- Full :core:test shows no new failures
- Manual 1–5 pass per cutscene; item 6 decision recorded
Entities and Components
Input Handling
Arrow Selection Wheel Arrow Selection Wheel — Sprint 3