How i3thcookie/cardgame works
CardGame is a turn-based terminal game where players manage cards, attack opponents, defend, and alter their movement and speed; the last surviving player wins. main.py creates players and starts the game loop, which dispatches player choices to combat, card, and movement actions and updates turn state. Player hands and decks hold the game’s card state, while movement techniques can influence combat and speed. The README also documents balancing these mechanics through constants. The graph reflects sampled source and documented capabilities; unsampled action details are grouped under their existing module path.
Main entry points: gameloop_actions.py Action handlers · player_class.py Player state · attack_func.py Combat resolution · movement_func.py Movement evaluation
Components 14
Game flow
- Game entry
code/main.py - Turn loop
code/gameloop_class.py
Player actions
- Action handlers
code/gameloop_actions.py
Game state
- Player state
code/player_class.py - Deck
code/deck_class.py - Card
code/card_class.py - Game rules
code/constants_libraries.py
Combat and movement
- Combat resolution
code/attack_func.py - Movement evaluation
code/movement_func.py - Tech effects
code/tech_func.py - Move techniques
code/move_tech_class.py - Vector operations
code/vector2_func.py
Terminal UI
- Game display
code/printing_func.py
Other components
- Player
Connections 31
- Player → Game entry: starts game
- Game entry → Turn loop: starts loop
- Game entry → Player state: creates players
- Turn loop → Action handlers: dispatches choices
- Turn loop → Player state: updates turns
- Turn loop → Game display: displays state
- Turn loop → Vector operations: decays speed
- Action handlers → Combat resolution: resolves attacks
- Action handlers → Movement evaluation: evaluates moves
- Action handlers → Tech effects: applies active tech
- Action handlers → Player state: changes player state
- Action handlers → Deck: draws and returns cards
- Action handlers → Card: creates modified cards
- Action handlers → Game display: shows choices
- Combat resolution → Movement evaluation: checks passive tech
- Combat resolution → Tech effects: applies combat effects
- Combat resolution → Vector operations: changes speed
- Combat resolution → Player state: changes combat state
- Movement evaluation → Move techniques: creates techniques
- Movement evaluation → Player state: changes speed and tech
- Movement evaluation → Vector operations: updates vectors
- Tech effects → Player state: updates tech and speed
- Tech effects → Vector operations: changes vectors
- Player state → Deck: owns deck
- Player state → Card: holds cards
- Deck → Card: generates cards
- Deck → Game rules: uses card rules
- Combat resolution → Game rules: uses combat rules
- Movement evaluation → Game rules: uses movement rules
- Tech effects → Game rules: uses tech rules
- Game display → Game rules: formats game data