How flkdpis/xiangqi works
Xiangqi is a pygame-based Chinese chess game, though the README marks this version obsolete. Its runtime starts in main.py, which initializes the game, creates the pieces and handles mouse-driven turns and captures. Piece movement and board rules live alongside rendering and game control in that same large file; variables.py supplies board, piece, and movement definitions, while functions.py provides occupancy and distance helpers. The excerpts show the core game loop but not all rendering or rules, so the graph stays at the evidenced module boundaries.
Main entry points: main.py Game loop and UI · variables.py Board and rule data · functions.py Move helpers
Components 6
Game runtime
- Game loop and UI
Xiangqi/main.py - Pieces and movement
Xiangqi/main.py - Board rendering
Xiangqi/main.py
Game data and helpers
- Board and rule data
Xiangqi/variables.py - Move helpers
Xiangqi/functions.py
Other components
- Player
Connections 6
- Player → Game loop and UI: starts and plays
README.md - Game loop and UI → Board and rule data: loads definitions
Xiangqi/main.py - Game loop and UI → Pieces and movement: creates pieces
Xiangqi/main.py - Game loop and UI → Move helpers: calls helpers
Xiangqi/main.py - Game loop and UI → Board rendering: draws board
Xiangqi/main.py - Pieces and movement → Board and rule data: uses move data
Xiangqi/main.py