How zeroxm/pokemon-roulette works
1. This is a client-side Angular 19 single-page game. The app shell lives in app.component, with route setup in app.routes.ts and global configuration in app.config.ts. There is no backend in the repo; gameplay, content, and state management are handled in the browser.
2. The top-level experience is split into route-like screens: the main game, trainer-team management, items, coffee, settings, credits, and a not-found screen. The app uses reusable button components such as the main game button, restart button, settings button, coffee button, and credits button to move between these areas.
3. The core gameplay loop is centered in src/app/main-game. That subtree contains the main game container plus a roulette system that drives most game events. The wheel component is the spinning interaction surface, while roulette-container selects and renders a specific roulette scenario.
4. The roulette system is the main architectural boundary. Each roulette component represents a different Pokémon-themed event or encounter: battles, item discovery, evolution checks, starter selection, fishing, fossils, caves, legendary encounters, paradox catches, gym/champion/elite-four battles, Team Rocket, shiny encounters, trades, and special story sequences. These are mostly isolated presentation/interaction modules that plug into the same container.
5. Most roulettes are data-driven from static tables in the repo rather than remote services. Generation-specific datasets such as pokemon-by-generation.ts, starter-by-generation.ts, champion-by-generation.ts, and similar files provide the content each roulette needs. This makes generation, region, and event selection a key content boundary in the design.
6. The domain logic is concentrated in src/app/services. These services encapsulate game rules and shared data such as Pokémon, Pokédex, generation, items, evolutions, type matchups, trainer sprites/forms, badges, rare candy behavior, and mega-stone handling. In the diagram, these services sit between UI components and the underlying static datasets/models.
7. Game state is managed separately from the UI. game-state-service, settings-service, badges-service, pokedex-service, and related services likely own the persistent browser-side progress and preferences that multiple screens need. This is the main cross-cutting state layer that ties gameplay, collection screens, and settings together.
8. Audio and feedback are part of the gameplay architecture. The public/ folder contains sound effects such as item found, PC login/logout, clicking, and Mega Evolution audio. sound-fx-service is the orchestration point for these assets, so sound is triggered by gameplay events rather than embedded directly in each component.
9. Internationalization and appearance are first-class concerns. Translation bundles live in src/assets/i18n for several languages, and the dark-mode/theme subsystem is implemented under services/dark-mode-service and services/theme-service, with matching UI in settings/dark-mode-toggle and settings/theme-selector. These are presentation-layer concerns that influence many screens.
10. The trainer and collection features form a second major user-facing subsystem outside the main game. trainer-team contains Pokédex, badges, and storage-PC views, backed by Pokémon/trainer data services. This area is distinct from the roulette loop: it is where accumulated game progress is inspected and managed.
11. Shared types and constants keep the content model consistent. The interfaces/ folder defines domain entities like Pokémon, items, gym leaders, forms, languages, wheel items, and type matchups, while constants/ holds fixed IDs and lookup values. This is the schema layer used by the services and roulette components.
12. Build and delivery are standard Angular CLI/GitHub Pages. The repository includes a GitHub Actions workflow, production/environment files, and angular.json. The README shows deployment to GitHub Pages with a /pokemon-roulette/ base href, which means the app is intended to run as a static hosted SPA.
Main entry points: app.routes.ts Routes · main-game.component.ts Main game · roulette-container.component.ts Roulette hub · trainer-team.component.ts Trainer team
Components 21
App shell
Routing, top-level screens, and shared navigation
- App shell · Top-level SPA shell that hosts routes and global layout
src/app/app.component.ts - Routes · Route map for game, collection, settings, credits, and fallback screens
src/app/app.routes.ts - App config · Global application providers and bootstrap configuration
src/app/app.config.ts - Settings · Theme, dark mode, and app preferences
src/app/settings/settings.component.ts - Credits · Attribution and project credits screen
src/app/credits/credits.component.ts
Main game
Core roulette loop and event presentation
- Main game · Primary gameplay screen and container for the roulette loop
src/app/main-game/main-game.component.ts - Roulette hub · Selects and mounts the active roulette scenario
src/app/main-game/roulette-container/roulette-container.component.ts - Wheel · Spinning interaction surface that drives game events
src/app/wheel/wheel.component.ts - Adventure start · Entry flow that kicks off a new run and advances into gameplay
src/app/main-game/roulette-container/roulettes/start-adventure-roulette/start-adventure-roulette.component.ts - Core roulettes · Representative event modules for battles, encounters, and special sequences
src/app/main-game/roulette-container/roulettes/main-adventure-roulette/main-adventure-roulette.component.ts - Aux roulettes · Supporting event modules for items, evolution, fishing, caves, and trades
src/app/main-game/roulette-container/roulettes/find-item-roulette/find-item-roulette.component.ts
Collection views
Trainer-team and progress management screens
- Trainer team · Hub for Pokédex, badges, and storage-PC management
src/app/trainer-team/trainer-team.component.ts - Pokédex · Pokédex browsing and detail experience
src/app/trainer-team/pokedex/pokedex.component.ts - Badges · Badge progress and earned achievements
src/app/trainer-team/badges/badges.component.ts - Storage PC · Stored Pokémon and party-adjacent management
src/app/trainer-team/storage-pc/storage-pc.component.ts
Services
State, rules, audio, theme, and shared domain logic
- Game state · Browser-side progress and cross-screen game state
src/app/services/game-state-service/game-state.service.ts - Domain rules · Pokémon, items, evolutions, generation, type matchups, and related gameplay logic
src/app/services/pokemon-service/pokemon.service.ts - Progress services · Pokédex, badges, settings, and trainer data services
src/app/services/pokedex-service/pokedex.service.ts - Audio FX · Sound effect orchestration for gameplay-triggered audio
src/app/services/sound-fx-service/sound-fx.service.ts - Theme layer · Dark mode and theme selection services
src/app/services/theme-service/theme.service.ts
Content data
Static generation- and domain-specific tables
- Static tables · Generation-based Pokémon, starters, champions, gyms, caves, fossils, and legendary data
src/app/main-game/roulette-container/roulettes/pokemon-from-generation-roulette/pokemon-by-generation.ts
Connections 27
- App shell → Routes: hosts · The shell renders routed screens
- App shell → App config: bootstraps · Root configuration is applied at startup
- Routes → Main game: routes to · Primary gameplay screen
- Routes → Trainer team: routes to · Trainer and collection screen
- Routes → Settings: routes to · Settings screen
- Routes → Credits: routes to · Credits screen
- Main game → Roulette hub: contains · Main game delegates event selection to roulette hub
- Main game → Wheel: uses · Wheel drives the central interaction loop
- Roulette hub → Adventure start: mounts · Entry scenario for a new adventure
- Roulette hub → Core roulettes: mounts · Battle and encounter scenarios
- Roulette hub → Aux roulettes: mounts · Item, evolution, travel, and trade scenarios
- Roulette hub → Static tables: reads · Roulette scenarios are fed by static content tables
- Core roulettes → Domain rules: uses · Event outcomes rely on shared domain logic
- Aux roulettes → Domain rules: uses · Support events consult gameplay rules and data
- Aux roulettes → Audio FX: triggers · Events emit sound feedback through the audio service
- Trainer team → Pokédex: contains · Collection browsing subview
- Trainer team → Badges: contains · Badge progress subview
- Trainer team → Storage PC: contains · Storage management subview
- Trainer team → Progress services: uses · Collection screens are backed by persistence and progress services
- Settings → Theme layer: uses · Theme and dark-mode controls
- Settings → Game state: uses · Preferences are persisted in browser state
- Main game → Game state: uses · Gameplay reads and updates persistent state
- Main game → Domain rules: uses · Game flow depends on shared rules services
- Progress services → Game state: persists via · Progress services store cross-screen data
- Domain rules → Static tables: indexes · Rules layer consumes the static content model
- Audio FX → Main game: supports · Audio responds to gameplay events
- Routes → Game state: shares state · Routes and screens rely on the same browser-side progress