I will now create src/utils/music.ts to procedurally synthesize adaptive background music (BGM) tracks (Title theme, Double Dungeon eerie exploration, Combat battle march, Boss apocalypse, and Shadow Monarch victory fanfare) using the Web Audio API, complete with a volume slider and real-time track transitions.
I will fix the TypeScript error in src/utils/music.ts by using standard number for the timer ID.
Now I will create src/data/story.ts to provide an immersive narrative storyline with cinematic story interludes between gates, quest dialogues from Association Chairman Go Gun-Hee, and System awakening prompts.
Now I will create src/components/StoryModal.tsx to render cinematic story dialogue popups with Chairman Go Gun-Hee or System notifications between chapters and gates.
I will remove the unused Crown import in src/components/StoryModal.tsx.
Now I will create src/components/AudioSettingsModal.tsx for the BGM music volume slider and audio toggles.
Now I'll integrate the storyline chapters, adaptive BGM tracks, and the audio settings modal into App.tsx. Let me read around the start screen and pause modal in App.tsx.
Let me check the gate advance logic in App.tsx where we can trigger story intro / boss dialogue. Let's read lines 550 to 650.
I will now update src/App.tsx to integrate adaptive BGM tracking, story chapter dialogues, and the new audio settings modal.
Let me clean up the unused imports and integrate musicMgr and StoryModal cleanly into App.tsx.
Let me use useEffect for BGM playback management in App.tsx. Let's add state for story chapters and audio settings modal.
Now I will add useEffect to trigger adaptive BGM based on screen, phase, and whether a boss is active.
Now I will wire the STORY_CHAPTERS into gate transitions so immersive story popups appear at the start of each major chapter.
Now let me render the StoryModal and AudioSettingsModal in App.tsx. Let's check where modals like PauseModal are rendered. Let's read lines 940 to 988.
Let me read lines 1000 to 1022.
Now I will add StoryModal and AudioSettingsModal into the modals layer of App.tsx and trigger story interludes when advancing to new gates.
Now I will render StoryModal and AudioSettingsModal in the render tree of App.tsx.
Now let me add an Audio Settings button to the PauseModal so players can adjust BGM volume and music preferences at any time. Let's read src/components/PauseModal.tsx.
Now I will update PauseModal.tsx to include an "Audio & Music Settings" button.
Now I will add the button inside PauseModal.tsx.
Now I'll import Music in PauseModal.tsx.
Now I will pass onOpenAudioSettings in App.tsx.
Now let me update PauseModal.tsx to destructure onOpenAudioSettings.
Now let me run build_project to ensure all TypeScript types and imports build cleanly.
I've successfully added an immersive storyline, adaptive BGM tracks with volume controls, and cinematic chapter popups. Here is a summary of what was added:
📖 1. Immersive Storyline Chapters (story.ts)
Instead of just jumping from dungeon to dungeon, the game now features an ongoing narrative following Sung Jin-Woo's ascent from an E-Rank weakling to the Shadow Monarch:
- Chapter I: The Double Dungeon Awakening (Altar of the System)
- Chapter II: The Steel-Fanged Swamp (Viper Toxin & Hunter Betrayal)
- Chapter III: The Frozen Red Gate Abyss (Blizzards of the White Wasteland)
- Chapter IV: The Job Change Sanctuary (Knight of the Red Throne & Igris)
- Chapter V: Cathedral of Blistering Flames (Orb of Avarice & High Orc Warlords)
- Chapter VI: The Infinite Shadow Realm (Kamish and the Monarchs of Eternity)
- Cinematic Chapter Popups (
StoryModal.tsx): Display atmospheric dialogue from Chairman Go Gun-Hee and System prompts between major gates and boss trials.
🎵 2. Adaptive Web Audio BGM & Volume Slider (music.ts & AudioSettingsModal.tsx)
- Procedural BGM Synthesizer: Automatically adapts its soundtrack based on where you are:
- Title Screen: Mysterious arpeggios (
'title')
- Dungeon Exploration: Eerie dungeon drones (
'exploration')
- Combat Battles: Intense battle rhythm (
'combat')
- Boss Encounters: Ominous boss march (
'boss')
- Victory / Game Over: Triumphant or mournful fanfares
- Audio & Music Settings Modal: Accessibly via the Pause menu (
[P] or [ESC]), featuring a live Music Volume slider (0–100%), BGM toggle, and SFX mute toggle.
Files built: src/utils/music.ts, src/data/story.ts, src/components/StoryModal.tsx, src/components/AudioSettingsModal.tsx, src/App.tsx, src/components/PauseModal.tsx