Overhaul all four games: authentic clockwise Ludo boards, cross-game polish, agent docs, and CI quality gates#16
Merged
Merged
Conversation
Replace the misaligned base-track rotation with one seat-0 quarter template rotated 90 degrees per seat, so every seat's start square, home column, yard, and finish wedge stay aligned by construction and tokens travel clockwise like classic Ludo apps. - settings.py: per-count SEAT_COLORS/SEAT_COLOR_NAMES tables (Player 1 is always blue and always the bottom seat; seats continue clockwise) replacing PLAYER_COLORS/PLAYER_NAMES. - game.py: seat colours are stamped onto players on construction, so restored saves repaint to match the current board palette. - board_render.py: DisplayLayout now carries seat_colors and cell_size; yards reordered to (BL, TL, TR, BR); yard token slots centered; centre wedges face their owners; name banners moved outside the board edge instead of covering track cells. - tests: new test_board_geometry.py locks track continuity, clockwise winding, start/yard adjacency, loop-end-to-home-entry handoff, home lanes marching inward, clockwise seating, and the seat colour table. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the star-shaped radial layout (yards at the arm tips) with the compact reference layout: yard triangles wedged between arms, one cream convex silhouette, and a central polygon hub. - Per-count RadialSpec tuning tables; arms sit at pi/2 - pi/n + tau*k/n so seat 0's yard points straight down and seats continue clockwise. - Track per arm: outbound lane away from the hub, tip cell, inbound lane back to the hub, giving a clockwise loop whose start cells sit beside their owners' yards and whose loop-ends (the arm tips) hand over orthogonally to the home columns marching into the hub. - Yards: colored triangles with white inner triangles, 2x2 token clusters, and name banners anchored outside the silhouette. - Hub: n-gon with one colored wedge per seat facing its home column and the live die rendered at the center via the new shared visual_theme.draw_die_face helper (also used by the HUD tray). - Geometry tests now cover 4, 5, and 6 players; the two superseded radial shape tests were removed along with dead radial helpers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Tokens now hop cell-by-cell along the track at constant speed instead of gliding in a straight line across the board. Captures and yard exits stay as single direct slides, matching how players physically move tokens. Speed lives in settings.TOKEN_HOP_SPEED. - The setup screen's abstract polygon previews are replaced with cached true-to-life thumbnails rendered via the new BoardRenderer.draw_static, with the selected player count highlighted. - The window icon now loads the bundled ludo_icon.ico (with the drawn fallback kept) and the PyInstaller spec bundles the file. - Removed dead code: the pre-overhaul sidebar drawers (_draw_score_panel, _draw_action_panel) and their now-orphaned ui helpers (draw_dice, _pip_offsets, draw_panel). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…split - Tokens now hop space-by-space after a dice roll (constant speed via settings.TOKEN_HOP_SPEED); jumps that are not a normal forward roll, such as Go To Jail, still slide directly. The existing AI pause while animations play is preserved. - ai.py: the bare valuation multipliers (2.35/1.32/0.28/1.12/0.95/0.08) are now named module constants with rationale comments, and every function is typed against MonopolyGame/Player via TYPE_CHECKING. - ui.Button and the main.py click/typing handlers gained type hints; _atomic_write's path parameter is now typed as Path. - The two long dispatchers were split behaviour-preserving: _on_button into setup/turn/asset/trade handlers with disjoint key families, and _playing_buttons into one small builder per dialog. - requirements.txt pins pygame-ce>=2.5.2 to match the other games. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- The bare magic numbers moved into documented settings.py constants: STRESS_PREVIEW_SHARE/STRESS_TIMER_SHARE (HUD stress phases), POSITION_CORRECTION_SOFTNESS (overlap solver), and MERGE_VELOCITY_DAMP (merged-body velocity). - New tests/ directory (the game previously had none): merge detection rules (tier matching, contact range, arming delay, max tier, one merge per body per frame, mass-weighted spawn, damped velocity), container physics guarantees (clamping, wall reflection, spawn span, trajectory preview bounds, symmetric separation), and data-table sanity for the tier ladder, spawn weights, and stress shares. All engine-only and headless. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- The ~650-line hint cluster in solitaire.py now opens with a pipeline map (generate -> filter -> rank -> describe), documents the wrapper-vs-_on_board naming convention for simulated boards, and warns that over-aggressive filters cause false loss verdicts. Stage banners mark the filter, ranking, and description sections. No behaviour change. - New tests/test_klondike_rules.py (the game previously had none): deal shape, full-deck integrity, draw/recycle cycle, tableau and foundation legality, scoring for foundation plays and reveals, snapshot/restore round trip, win detection, and three hint-engine checks (reveal-first ranking, hint-to-selection legality, and the empty-king-shuffle filter). KlondikeGame never touches Tk, so the suite runs headless. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Monopoly's four terse test modules now carry the same docstring style as the rest of the repo (class summaries plus one-line test intents). - The Ludo READMEs describe the new boards accurately: classic square cross for 4P, compact radial boards for 5P/6P, clockwise movement, Player 1 blue at the bottom, and the geometry test suite. - Orbital Orchard and Solitaire READMEs document their new tests/ folders and how to run them headless. - The root README gains a Tests section covering all four suites, the SDL dummy driver, and the three autotest modes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Tooling (mirroring the house style of the sibling repos): - pyproject.toml: ruff (line-length 120, py311, E/W/F/I/B/UP/C4/SIM/RUF, per-file ignores for the tests' sys.path shim and the two Monopoly data-table modules), shared mypy flags (check_untyped_defs, no_implicit_optional, warn_redundant_casts, warn_unused_ignores), and bandit with documented B101/B311/B110 skips. The four game folders share module names, so mypy runs once per folder. - .pre-commit-config.yaml: check-only ruff plus merge-conflict/yaml/ large-file/debug-statement hooks. - requirements-dev.txt: exact-pinned ruff/mypy/bandit/pytest/pytest-cov/ pip-audit/pre-commit toolchain. Code changes to reach a clean bill: - ~180 auto-fixes (pep585/604 annotations, import order, pyupgrade) plus hand fixes for long lines, collapsible branches, contextlib.suppress, zip strict=True, and one unused variable. - Ludo: TokenState now declares _finished_steps as a real field instead of an injected attribute; LudoGame accepts a Sequence of seat specs; color helpers return explicit RGB 3-tuples; roll handling narrows the die value; UI smoke tests import helpers directly. - Monopoly: an explicit _require_game() invariant helper replaces Optional derefs across the app layer; auction/trade/pending-purchase states are narrowed where dialogs guarantee them. - Orbital Orchard: merge candidates are typed against CelestialBody; nebula loop variables no longer shadow a differently-shaped tuple. - Solitaire: annotations for the hint cache and tkinter label style. All four test suites, the three headless autotests, ruff, mypy (x4), bandit, and compileall pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GitHub Actions gate on every PR and push to main, Python 3.11 + 3.13: pre-commit config validation; the four test suites run from inside each game folder with per-game engine coverage floors (Ludo 75, Monopoly 80, Orbital Orchard 90, Solitaire 32 -- each ~5 points under the measured value at introduction); the three headless pygame autotests; compileall; ruff; mypy once per game folder (the folders share flat module names); bandit; and pip-audit over the pinned dev toolchain and game runtime deps. SDL dummy drivers keep everything headless. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AGENTS.md is the single source of truth for any coding agent: what the four games are, the mandatory workflow skills, the repository map, the UI-free-engine + thin-shell architecture pattern, coding conventions (self-contained game folders, flat imports, settings-owned tuning knobs, docstring style, %APPDATA% persistence, narrowing asserts, seeded randomness), the exact quality-gate commands CI runs, Windows/PowerShell gotchas, testing conventions, PyInstaller builds, and git/PR rules. CLAUDE.md simply @-imports it so the two can never drift. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
One staged overhaul of all four games, in four jobs:
1. Ludo board authenticity + clockwise movement
tests/test_board_geometry.pylocks track continuity, clockwise winding, start/yard adjacency, loop-end-to-home handoff, and clockwise seating for every player count.2. Improvements across all four games
3. Agent docs
AGENTS.md(~215 lines): architecture pattern, conventions, exact quality-gate commands, Windows gotchas, testing/build/PR rules.CLAUDE.mdthin-imports it.4. Quality gates + CI
pyproject.toml(ruff/mypy/bandit), check-only pre-commit config, pinnedrequirements-dev.txt, and aQuality & Securityworkflow (Python 3.11 + 3.13): per-game pytest with coverage floors (75/80/90/32), three headless autotests, compileall, ruff, mypy x4, bandit, pip-audit. The entire repo was brought to a clean bill first (~180 auto-fixes + typed Optional-state cleanups such as Monopoly's_require_game()).Verification
LUDO_AUTOTEST/MONOPOLY_AUTOTEST/ORBITAL_ORCHARD_AUTOTESTall exit 0 headless.Notes for the reviewer
🤖 Generated with Claude Code