How rurouni88/pc3-ptsd works
PTSD is a mobile-first satirical roguelike in which the player chooses a relative and tries to resolve device problems before time or battery runs out. The documented flow is boot and difficulty/seed selection, a timed phone-interface run with interruptions and mini-games, then results and replay; a separate gym offers mini-games. Supporting branches provide saved runs, achievements/leaderboard, settings, localization and audio/haptic feedback. The main orchestration links are supported by the SOURCE INDEX and excerpts; unsampled mini-game internals are represented by their registry/directory, not inferred as separate runtime stages.
Main entry points: useGameEngine.ts Run state engine · App.tsx Application flow · BootScreen.tsx Boot and selection · SettingsModal.tsx Settings controls
Components 24
Game flow
- Application flow
src/App.tsx - Boot and selection
src/screens/BootScreen.tsx - Timed phone run
src/screens/OSInterface.tsx - Run state engine
src/hooks/useGameEngine.ts - Game timer
src/hooks/useGameTimer.ts - Mini-game registry
src/components/mini-games/registry.tsx - Mini-game challenges
src/components/mini-games - Mini-game gym
src/screens/MiniGameGym.tsx - Run results
src/screens/Results.tsx
Game content
- Difficulty content
src/config/levels.ts - Seeded randomness
src/engine/seeded-rng.ts - Game translations
src/config/translations.ts
Progress and records
- Run saves
src/engine/save.ts - Leaderboard records
src/engine/meta.ts - Achievements
src/engine/achievements.ts
Player experience
- Leaderboard view
src/components/LeaderboardModal.tsx - Achievement view
src/components/AchievementsModal.tsx - Settings controls
src/components/SettingsModal.tsx - Theme preferences
src/engine/theme.ts - Font scaling
src/engine/font-scale.ts
Feedback systems
- Sound effects
src/engine/sound.ts - Background music
src/engine/bgm.ts - Haptic feedback
src/engine/haptics.ts
Other components
- Player
Connections 35
- Player → Application flow: plays
src/App.tsx - Application flow → Boot and selection: shows
src/App.tsx - Boot and selection → Application flow: starts run
src/App.tsx - Boot and selection → Difficulty content: offers difficulty
src/screens/BootScreen.tsx - Boot and selection → Seeded randomness: seeds run
src/screens/BootScreen.tsx - Application flow → Timed phone run: routes to run
src/App.tsx - Application flow → Difficulty content: selects level
src/App.tsx - Timed phone run → Run state engine: uses run state
src/screens/OSInterface.tsx - Run state engine → Game timer: uses timer
src/hooks/useGameEngine.ts - Timed phone run → Mini-game registry: dispatches challenges
src/screens/OSInterface.tsx - Mini-game registry → Mini-game challenges: registers games
- Application flow → Mini-game gym: opens gym
src/App.tsx - Mini-game gym → Mini-game registry: selects challenge
src/screens/MiniGameGym.tsx - Run state engine → Seeded randomness: selects issues
src/hooks/useGameEngine.ts - Run state engine → Run saves: persists run
src/hooks/useGameEngine.ts - Application flow → Run saves: loads continuation
src/App.tsx - Run state engine → Achievements: checks results
src/hooks/useGameEngine.ts - Run state engine → Leaderboard records: records run
src/hooks/useGameEngine.ts - Run state engine → Application flow: completes run
src/App.tsx - Application flow → Run results: shows outcome
src/App.tsx - Run results → Leaderboard records: reads records
src/screens/Results.tsx - Run results → Achievements: reads unlocks
src/screens/Results.tsx - Boot and selection → Achievement view: opens achievements
src/screens/BootScreen.tsx - Boot and selection → Leaderboard view: opens leaderboard
src/screens/BootScreen.tsx - Achievement view → Achievements: reads achievements
src/components/AchievementsModal.tsx - Leaderboard view → Leaderboard records: reads records
src/components/LeaderboardModal.tsx - Boot and selection → Settings controls: opens settings
src/screens/BootScreen.tsx - Settings controls → Theme preferences: loads and saves
src/components/SettingsModal.tsx - Settings controls → Font scaling: loads and saves
src/components/SettingsModal.tsx - Settings controls → Sound effects: configures audio
src/components/SettingsModal.tsx - Settings controls → Background music: configures music
src/components/SettingsModal.tsx - Run state engine → Sound effects: plays effects
src/hooks/useGameEngine.ts - Run state engine → Haptic feedback: triggers vibration
src/hooks/useGameEngine.ts - Background music → Sound effects: reads volume
src/engine/bgm.ts - Mini-game challenges → Game translations: uses translations
src/components/mini-games/PasskeySetup.tsx