How waxmell99/live_till_the_end works
Survive Until the War Ends is an offline, browser-based Western Front survival game. Players create a soldier, then repeatedly read a scene and choose an action; the engine resolves risk, effects, time, events, and possible endings, while the app saves each updated life. Supporting branches expose the diary, letters, comrades, map, and historical archive, and present the authored game in English or Chinese. The graph follows relationships shown by README and source-index references; some UI wiring and unsampled subsystem internals are not excerpted, so those links are omitted.
Main entry points: GameScreen.tsx Game screen · engine.ts Game engine · App.tsx App flow · Dossier.tsx Field dossier
Components 25
Game interface
- App flow
src/App.tsx - Character creation
src/components/CharacterCreation.tsx - Opening screen
src/components/IntroScreen.tsx - Game screen
src/components/GameScreen.tsx - Event choices
src/components/EventPanel.tsx - Status panel
src/components/StatusPanel.tsx - Comrades panel
src/components/ComradesPanel.tsx - Field dossier
src/components/Dossier.tsx - Field map
src/components/MapPanel.tsx - Ending screen
src/components/EndScreen.tsx - Ambient sound
src/hooks/useAmbientSound.ts
Game rules
- Game engine
src/game/engine.ts - Seeded randomness
src/game/random.ts - Save and restore
src/game/save.ts - Life simulation
src/game/simulation.ts - Narrative presentation
src/game/presentation.ts
World and stories
- Event catalogue
src/data/events - Historical records
src/data/history.ts - Letters
src/data/letters.ts - Comrade definitions
src/data/npcs.ts
Localization
- Chinese authored content
src/i18n/events-people.zh.ts - Content localization
src/i18n/content.ts - Language preference
src/i18n/index.tsx - Language switcher
src/components/LanguageSwitcher.tsx
Other components
- Player
Connections 36
- Player → Opening screen: starts or continues
README.md - Opening screen → App flow: requests game flow
src/App.tsx - App flow → Save and restore: loads and saves
src/App.tsx - App flow → Character creation: opens creation
src/App.tsx - Character creation → App flow: submits profile
src/App.tsx - App flow → Game engine: creates life
src/App.tsx - App flow → Game screen: renders active life
src/App.tsx - Game screen → Game engine: resolves choices
src/components/GameScreen.tsx - Game screen → Event choices: renders scene
src/components/GameScreen.tsx - Game screen → Status panel: renders status
src/components/GameScreen.tsx - Game screen → Comrades panel: renders comrades
src/components/GameScreen.tsx - Game screen → Field dossier: opens dossier
src/components/GameScreen.tsx - Game screen → Field map: renders map
src/components/GameScreen.tsx - Game screen → Ending screen: renders ending
src/components/GameScreen.tsx - Game screen → Save and restore: persists life
README.md - Game screen → Ambient sound: uses ambience
src/components/GameScreen.tsx - Event choices → Game engine: gets event and choices
src/components/EventPanel.tsx - Game engine → Seeded randomness: draws seeded results
src/game/engine.ts - Game engine → Event catalogue: selects event
src/game/engine.ts - Game engine → Historical records: reads timeline
src/game/engine.ts - Game engine → Letters: records received letters
src/game/engine.ts - Game engine → Comrade definitions: reads comrade data
src/game/engine.ts - Life simulation → Game engine: exercises game rules
src/game/simulation.ts - Event choices → Narrative presentation: renders narrative
src/components/EventPanel.tsx - Field dossier → Historical records: shows archive
src/components/Dossier.tsx - Field dossier → Letters: shows kept letters
src/components/Dossier.tsx - Field dossier → Narrative presentation: formats entries
src/components/Dossier.tsx - Comrades panel → Comrade definitions: shows comrades
src/components/ComradesPanel.tsx - Narrative presentation → Comrade definitions: resolves names
src/game/presentation.ts - Content localization → Event catalogue: looks up source events
src/i18n/content.ts - Content localization → Chinese authored content: uses Chinese text
src/i18n/content.ts - Language preference → Content localization: provides language
src/i18n/content.ts - Language switcher → Language preference: changes preference
src/components/LanguageSwitcher.tsx - Character creation → Language preference: uses translations
src/components/CharacterCreation.tsx - Event choices → Content localization: localizes scene
src/components/EventPanel.tsx - Field dossier → Content localization: localizes archive
src/components/Dossier.tsx