Browser-based 2D soccer game built with React 19 + Vite, rendered on Canvas 2D (no external game engine).
src/components/) — React handles menus, HUD, overlayssrc/engine/) — Pure JS game loop, physics, AIsrc/engine/Game.js — Core loop & state machine (KICKOFF → PLAYING → GOAL_SCORED → HALFTIME → FULLTIME)src/engine/Player.js — Movement, stamina, renderingsrc/engine/Ball.js — Physics with friction & height/lofting for crossessrc/engine/AI.js — Formation holding, chasing, passing, shooting behaviorsrc/engine/Goalkeeper.js — Shot reaction, diving, clearingsrc/engine/constants.js — All config, formations, 3 difficulty presets (Easy/Medium/Hard)src/engine/Input.js — Keyboard input (WASD + JKL + Space)src/engine/EventBus.js — Pub/sub event systemsrc/engine/Field.js — Canvas field renderingsrc/components/GameView.jsx — Wires canvas to Game engine + React overlayssrc/components/MainMenu.jsx — Difficulty picker, practice mode togglesrc/components/HUD.jsx — Live score/clocksrc/components/GoalOverlay.jsx — Goal celebration animationsrc/components/MatchEnd.jsx — Final score screennpm run dev # Vite dev server
npm run build # Production build to dist/