How syamkushaini/kempen-222-game works
Kempen 222 is a browser-based Malaysian political strategy game. Players choose a by-election, state or general contest, a hung-parliament negotiation, or a multi-term career; they manage a party and campaign, then see election results and, where needed, form a government. The browser UI dispatches player choices through a central store into campaign and election simulation modules. The README documents broad features such as polling, party management, House business and career events; some of those implementations were not sampled, so their connections are shown only where documented or indexed.
Main entry points: store.ts Game command store · election.ts Election outcomes · App.tsx Game screens · career.ts Career simulation
Components 22
Browser interface
- Game screens
src/ui/App.tsx - Campaign screens
src/ui/ActionsTab.tsx - Government talks
src/ui/Formation.tsx - Election night
src/ui/ElectionNight.tsx - Contest map
src/ui/MapView.tsx
Game state
- Game command store
src/state/store.ts - Game setup and migration
src/state/game.ts - Saves and profile
src/state/saves.ts
Campaign and career
- Campaign turns
src/sim/campaign/turn.ts - Campaign actions
src/sim/campaign/actions.ts - Career simulation
src/sim/campaign/career.ts - Party diplomacy
src/sim/campaign/diplomacy.ts - Government formation
src/sim/campaign/formation.ts - House and government
src/sim/campaign/govern.ts - Campaign polling
src/sim/campaign/polls.ts - Career events
src/sim/campaign/events.ts
Election simulation
- Election outcomes
src/sim/election.ts - Seat projection
src/sim/project.ts - Voter dynamics
src/sim/dynamics.ts
Game data and language
- Contest scenarios
src/data/world.ts - Localized game text
src/i18n/strings.ts
Other components
- Player
Connections 28
- Player → Game screens: plays
README.md - Game screens → Game command store: dispatches choices
src/ui/App.tsx - Campaign screens → Game command store: dispatches actions
- Government talks → Game command store: dispatches offers
src/ui/Formation.tsx - Game command store → Contest scenarios: loads scenario
src/state/store.ts - Game command store → Career simulation: calls career logic
src/state/store.ts - Game command store → Party diplomacy: resolves scenes
src/state/store.ts - Game command store → Government formation: handles offers
src/state/store.ts - Game command store → House and government: calls government logic
src/state/store.ts - Game command store → Game setup and migration: mutates game state
src/state/store.ts - Game command store → Saves and profile: persists saves
src/state/store.ts - Game screens → Campaign screens: renders screens
src/ui/App.tsx - Game screens → Government talks: renders talks
src/ui/App.tsx - Election night → Game command store: reads game state
src/ui/ElectionNight.tsx - Contest map → Game command store: reads game state
src/ui/MapView.tsx - Campaign turns → Campaign actions: applies actions
src/sim/campaign/turn.ts - Campaign turns → Party diplomacy: runs diplomacy
src/sim/campaign/turn.ts - Career simulation → Campaign turns: advances campaign
src/sim/campaign/career.ts - Career simulation → Career events: processes events
src/sim/campaign/career.ts - Career simulation → House and government: runs House systems
src/sim/campaign/career.ts - Party diplomacy → Election outcomes: projects pact effects
src/sim/campaign/diplomacy.ts - Government formation → Election outcomes: uses seat results
- Election outcomes → Seat projection: projects seats
src/sim/election.ts - Election outcomes → Voter dynamics: applies voter shifts
src/sim/election.ts - Contest scenarios → Election outcomes: builds contest world
src/data/world.ts - Campaign screens → Campaign polling: shows polling
README.md - Election night → Election outcomes: shows election results
src/ui/ElectionNight.tsx - Game screens → Localized game text: localizes interface
README.md