Dodge-survival game with a polished desktop build (Python/pygame), a reliable web hub (HTML5 canvas — no WebAssembly) including Neon Circuit (car arena with human / AI / versus + engine audio), and an ML / RL stack: tabular Double Q on dodge, DQN on a discrete car-ring env, documented in ml/ALGORITHMS.md.
The site is served from the web/ folder (plain HTML + Canvas + JavaScript). Pygbag is no longer required — deployment is a simple static upload.
- Push
mainand wait for Actions → Deploy to GitHub Pages to finish. - Settings → Pages → source Deploy from a branch →
gh-pages/ (root). - Open
https://<user>.github.io/<repo>/(e.g.https://pat749.github.io/dodger-game/).
Hard-refresh after updates (Ctrl+Shift+R). Use a Chromium-based browser for best results.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd game
python main.pyLegacy launcher: python dodger.py in Dodger-game python/Dodger-master/ (forwards to game/main.py).
See ml/README.md and ml/ALGORITHMS.md. Summary:
ml/dodge_env.py+ml/train_q.py— tabular Q / Double Q →ml/checkpoints/q_table.json.ml/car_env.py+ml/train_dqn_car.py— DQN (PyTorch) →ml/checkpoints/dqn_car.pt.
pip install -r requirements-ml.txt
python3 -m ml.train_q --seed 0
pip install -r requirements-ml-rl.txt
python3 -m ml.train_dqn_car --steps 20000
python3 -m ml.eval_dqn_car --episodes 300
python3 -m ml.export_dqn_car_web # optional: Neon Circuit AI in the browser (see web/dqn_car_policy.json)CITATION.cff is included for GitHub’s “Cite this repository” widget.
| Path | Role |
|---|---|
web/ |
GitHub Pages hub: Dodger + Car arena (index.html, dodger.*, car.*) |
game/ |
Python/pygame sources + assets |
ml/ |
MDPs + train_q + train_dqn_car |
.github/workflows/github-pages.yml |
Deploy web/ → gh-pages |
requirements.txt |
Desktop game (pygame-ce) |
requirements-ml.txt |
NumPy for tabular RL |
requirements-ml-rl.txt |
PyTorch + NumPy for DQN |
| Menu | ↑↓ or W/S, Enter |
| 1P | Mouse + WASD / arrows; Z / X cheats (1P, desktop) |
| 2P | P1 WASD · P2 arrows |
| Pause | P · Esc menu |
- Old Jekyll /
docserrors: usegh-pages+/ (root), not/docs, for the live game (seedocs/note in earlier commits if applicable). - Pygbag black screen: use the
web/build instead; it is the supported browser target now.
Extended from the classic Dodger-style pygame tutorial; web and RL layers added for teaching and research demos.