# giaputc/game_uno architecture

> Architecture diagram of the GitHub repository giaputc/game_uno, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/giaputc/game_uno
- Repository: https://github.com/giaputc/game_uno

## Overview

This is a Pygame UNO game with solo-versus-bot and three-/four-player modes. The user selects a mode and difficulty, then plays through a controller that applies game rules and updates the matching game view; bot strategies choose AI moves. The README also documents scoring, UNO penalties, and mode-dependent stacking rules. The graph follows relationships visible in excerpts, the SOURCE INDEX, or README; unsampled capabilities are included where documented, but their internal links are not asserted without evidence.

Main entry points: [`Controller/app_manager.py`](https://github.com/giaputc/game_uno/blob/main/Controller/app_manager.py) (App Manager), [`Controller/DonNguoiChoi/single_controller.py`](https://github.com/giaputc/game_uno/blob/main/Controller/DonNguoiChoi/single_controller.py) (Solo Controller), [`Controller/DaNguoiChoi/multi_controller.py`](https://github.com/giaputc/game_uno/blob/main/Controller/DaNguoiChoi/multi_controller.py) (Multiplayer Controller), [`view/font_helper.py`](https://github.com/giaputc/game_uno/blob/main/view/font_helper.py) (Text Rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App Runtime"]
  node_main["Game Entry<br/>[main.py]"]
  node_app["App Manager<br/>[app_manager.py]"]
  node_settings["Game Settings<br/>[settings.py]"]
end

subgraph group_interface["Game Interface"]
  node_menus["Menu Screens<br/>[menu_view.py]"]
  node_role["Guide Screens<br/>[role_view.py]"]
  node_difficulty["Difficulty Screen<br/>[difficulty_view.py]"]
  node_multi_select["Player Count Screen"]
  node_single_view["Solo Game View"]
  node_multi_view["Multiplayer View<br/>[multi_game_view.py]"]
  node_font["Text Rendering<br/>[font_helper.py]"]
  node_sound["Sound Effects<br/>[sfx_manager.py]"]
  node_landing["Landing Animation<br/>[landing_page.py]"]
end

subgraph group_play["Gameplay"]
  node_single["Solo Controller"]
  node_multi["Multiplayer Controller"]
  node_logic["Game Rules<br/>[game_logic.py]"]
  node_uno_game["Alternate Game Model<br/>[uno_game.py]"]
  node_play_controller["Alternate Play Controller<br/>[play_controller.py]"]
  node_deck["Card Deck<br/>[deck.py]"]
  node_card["Card Model<br/>[card.py]"]
  node_player_model["Player State<br/>[player.py]"]
end

subgraph group_ai["Bot Strategies"]
  node_easy["Easy Bot<br/>[easy_bot.py]"]
  node_normal["Normal Bot<br/>[normal_bot.py]"]
  node_hard["Hard Bot<br/>[hard_bot.py]"]
end

node_player(("Player"))

node_player -->|"starts game"| node_main
node_main -->|"creates"| node_app
node_app -->|"loads buttons"| node_settings
node_app -->|"displays"| node_menus
node_app -->|"displays"| node_role
node_app -->|"displays"| node_difficulty
node_app -->|"displays"| node_multi_select
node_app -->|"dispatches"| node_single
node_app -->|"dispatches"| node_multi
node_app -->|"updates"| node_landing
node_app -->|"initializes"| node_sound
node_single -->|"creates game"| node_logic
node_single -->|"creates players"| node_player_model
node_single -->|"updates and draws"| node_single_view
node_single -->|"selects strategy"| node_easy
node_single -->|"selects strategy"| node_normal
node_single -->|"selects strategy"| node_hard
node_single -->|"renders text"| node_font
node_single -->|"plays effects"| node_sound
node_multi -->|"creates game"| node_logic
node_multi -->|"creates players"| node_player_model
node_multi -->|"updates and draws"| node_multi_view
node_multi -->|"selects strategy"| node_easy
node_multi -->|"selects strategy"| node_normal
node_multi -->|"selects strategy"| node_hard
node_multi -->|"renders text"| node_font
node_multi -->|"plays effects"| node_sound
node_logic -->|"uses deck"| node_deck
node_deck -->|"creates cards"| node_card
node_play_controller -->|"controls game"| node_uno_game
node_play_controller -->|"uses view"| node_single_view
node_uno_game -->|"uses deck"| node_deck
node_uno_game -->|"selects strategy"| node_easy
node_uno_game -->|"selects strategy"| node_normal
node_uno_game -->|"selects strategy"| node_hard
node_menus -->|"renders text"| node_font
node_role -->|"renders text"| node_font
node_difficulty -->|"renders text"| node_font
node_multi_select -->|"renders text"| node_font
node_single_view -->|"renders text"| node_font
node_multi_view -->|"renders text"| node_font

click node_main "https://github.com/giaputc/game_uno/blob/main/main.py"
click node_app "https://github.com/giaputc/game_uno/blob/main/Controller/app_manager.py"
click node_settings "https://github.com/giaputc/game_uno/blob/main/settings.py"
click node_menus "https://github.com/giaputc/game_uno/blob/main/view/menu_view.py"
click node_role "https://github.com/giaputc/game_uno/blob/main/view/role_view.py"
click node_difficulty "https://github.com/giaputc/game_uno/blob/main/view/DonNguoiChoi/difficulty_view.py"
click node_multi_select "https://github.com/giaputc/game_uno/blob/main/view/DaNguoiChoi/multi_select_view.py"
click node_single_view "https://github.com/giaputc/game_uno/blob/main/view/DonNguoiChoi/single_game_view.py"
click node_multi_view "https://github.com/giaputc/game_uno/blob/main/view/DaNguoiChoi/multi_game_view.py"
click node_font "https://github.com/giaputc/game_uno/blob/main/view/font_helper.py"
click node_sound "https://github.com/giaputc/game_uno/blob/main/view/sfx_manager.py"
click node_single "https://github.com/giaputc/game_uno/blob/main/Controller/DonNguoiChoi/single_controller.py"
click node_multi "https://github.com/giaputc/game_uno/blob/main/Controller/DaNguoiChoi/multi_controller.py"
click node_logic "https://github.com/giaputc/game_uno/blob/main/model/game_logic.py"
click node_uno_game "https://github.com/giaputc/game_uno/blob/main/model/uno_game.py"
click node_play_controller "https://github.com/giaputc/game_uno/blob/main/Controller/DonNguoiChoi/play_controller.py"
click node_deck "https://github.com/giaputc/game_uno/blob/main/model/deck.py"
click node_card "https://github.com/giaputc/game_uno/blob/main/model/card.py"
click node_player_model "https://github.com/giaputc/game_uno/blob/main/model/player.py"
click node_easy "https://github.com/giaputc/game_uno/blob/main/bots/easy_bot.py"
click node_normal "https://github.com/giaputc/game_uno/blob/main/bots/normal_bot.py"
click node_hard "https://github.com/giaputc/game_uno/blob/main/bots/hard_bot.py"
click node_landing "https://github.com/giaputc/game_uno/blob/main/model/landing_page.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_app,node_settings toneBlue
class node_menus,node_role,node_difficulty,node_multi_select,node_single_view,node_multi_view,node_font,node_sound,node_landing toneAmber
class node_single,node_multi,node_logic,node_uno_game,node_play_controller,node_deck,node_card,node_player_model toneMint
class node_easy,node_normal,node_hard toneRose
class node_player toneIndigo
```

## Components

### App Runtime

- [Game Entry](https://github.com/giaputc/game_uno/blob/main/main.py): `main.py`
- [App Manager](https://github.com/giaputc/game_uno/blob/main/Controller/app_manager.py): `Controller/app_manager.py`
- [Game Settings](https://github.com/giaputc/game_uno/blob/main/settings.py): `settings.py`

### Game Interface

- [Menu Screens](https://github.com/giaputc/game_uno/blob/main/view/menu_view.py): `view/menu_view.py`
- [Guide Screens](https://github.com/giaputc/game_uno/blob/main/view/role_view.py): `view/role_view.py`
- [Difficulty Screen](https://github.com/giaputc/game_uno/blob/main/view/DonNguoiChoi/difficulty_view.py): `view/DonNguoiChoi/difficulty_view.py`
- [Player Count Screen](https://github.com/giaputc/game_uno/blob/main/view/DaNguoiChoi/multi_select_view.py): `view/DaNguoiChoi/multi_select_view.py`
- [Solo Game View](https://github.com/giaputc/game_uno/blob/main/view/DonNguoiChoi/single_game_view.py): `view/DonNguoiChoi/single_game_view.py`
- [Multiplayer View](https://github.com/giaputc/game_uno/blob/main/view/DaNguoiChoi/multi_game_view.py): `view/DaNguoiChoi/multi_game_view.py`
- [Text Rendering](https://github.com/giaputc/game_uno/blob/main/view/font_helper.py): `view/font_helper.py`
- [Sound Effects](https://github.com/giaputc/game_uno/blob/main/view/sfx_manager.py): `view/sfx_manager.py`
- [Landing Animation](https://github.com/giaputc/game_uno/blob/main/model/landing_page.py): `model/landing_page.py`

### Gameplay

- [Solo Controller](https://github.com/giaputc/game_uno/blob/main/Controller/DonNguoiChoi/single_controller.py): `Controller/DonNguoiChoi/single_controller.py`
- [Multiplayer Controller](https://github.com/giaputc/game_uno/blob/main/Controller/DaNguoiChoi/multi_controller.py): `Controller/DaNguoiChoi/multi_controller.py`
- [Game Rules](https://github.com/giaputc/game_uno/blob/main/model/game_logic.py): `model/game_logic.py`
- [Alternate Game Model](https://github.com/giaputc/game_uno/blob/main/model/uno_game.py): `model/uno_game.py`
- [Alternate Play Controller](https://github.com/giaputc/game_uno/blob/main/Controller/DonNguoiChoi/play_controller.py): `Controller/DonNguoiChoi/play_controller.py`
- [Card Deck](https://github.com/giaputc/game_uno/blob/main/model/deck.py): `model/deck.py`
- [Card Model](https://github.com/giaputc/game_uno/blob/main/model/card.py): `model/card.py`
- [Player State](https://github.com/giaputc/game_uno/blob/main/model/player.py): `model/player.py`

### Bot Strategies

- [Easy Bot](https://github.com/giaputc/game_uno/blob/main/bots/easy_bot.py): `bots/easy_bot.py`
- [Normal Bot](https://github.com/giaputc/game_uno/blob/main/bots/normal_bot.py): `bots/normal_bot.py`
- [Hard Bot](https://github.com/giaputc/game_uno/blob/main/bots/hard_bot.py): `bots/hard_bot.py`

### Other components

- **Player**

## Connections

- Player → Game Entry: starts game (evidence: `README.md`)
- Game Entry → App Manager: creates (evidence: `main.py`)
- App Manager → Game Settings: loads buttons (evidence: `Controller/app_manager.py`)
- App Manager → Menu Screens: displays (evidence: `Controller/app_manager.py`)
- App Manager → Guide Screens: displays (evidence: `Controller/app_manager.py`)
- App Manager → Difficulty Screen: displays (evidence: `Controller/app_manager.py`)
- App Manager → Player Count Screen: displays (evidence: `Controller/app_manager.py`)
- App Manager → Solo Controller: dispatches (evidence: `Controller/app_manager.py`)
- App Manager → Multiplayer Controller: dispatches (evidence: `Controller/app_manager.py`)
- App Manager → Landing Animation: updates (evidence: `Controller/app_manager.py`)
- App Manager → Sound Effects: initializes (evidence: `Controller/app_manager.py`)
- Solo Controller → Game Rules: creates game (evidence: `Controller/DonNguoiChoi/single_controller.py`)
- Solo Controller → Player State: creates players (evidence: `Controller/DonNguoiChoi/single_controller.py`)
- Solo Controller → Solo Game View: updates and draws (evidence: `Controller/DonNguoiChoi/single_controller.py`)
- Solo Controller → Easy Bot: selects strategy (evidence: `Controller/DonNguoiChoi/single_controller.py`)
- Solo Controller → Normal Bot: selects strategy (evidence: `Controller/DonNguoiChoi/single_controller.py`)
- Solo Controller → Hard Bot: selects strategy (evidence: `Controller/DonNguoiChoi/single_controller.py`)
- Solo Controller → Text Rendering: renders text (evidence: `Controller/DonNguoiChoi/single_controller.py`)
- Solo Controller → Sound Effects: plays effects (evidence: `Controller/DonNguoiChoi/single_controller.py`)
- Multiplayer Controller → Game Rules: creates game (evidence: `Controller/DaNguoiChoi/multi_controller.py`)
- Multiplayer Controller → Player State: creates players (evidence: `Controller/DaNguoiChoi/multi_controller.py`)
- Multiplayer Controller → Multiplayer View: updates and draws (evidence: `Controller/DaNguoiChoi/multi_controller.py`)
- Multiplayer Controller → Easy Bot: selects strategy (evidence: `Controller/DaNguoiChoi/multi_controller.py`)
- Multiplayer Controller → Normal Bot: selects strategy (evidence: `Controller/DaNguoiChoi/multi_controller.py`)
- Multiplayer Controller → Hard Bot: selects strategy (evidence: `Controller/DaNguoiChoi/multi_controller.py`)
- Multiplayer Controller → Text Rendering: renders text (evidence: `Controller/DaNguoiChoi/multi_controller.py`)
- Multiplayer Controller → Sound Effects: plays effects (evidence: `Controller/DaNguoiChoi/multi_controller.py`)
- Game Rules → Card Deck: uses deck (evidence: `model/game_logic.py`)
- Card Deck → Card Model: creates cards (evidence: `model/deck.py`)
- Alternate Play Controller → Alternate Game Model: controls game (evidence: `Controller/DonNguoiChoi/play_controller.py`)
- Alternate Play Controller → Solo Game View: uses view (evidence: `Controller/DonNguoiChoi/play_controller.py`)
- Alternate Game Model → Card Deck: uses deck (evidence: `model/uno_game.py`)
- Alternate Game Model → Easy Bot: selects strategy (evidence: `model/uno_game.py`)
- Alternate Game Model → Normal Bot: selects strategy (evidence: `model/uno_game.py`)
- Alternate Game Model → Hard Bot: selects strategy (evidence: `model/uno_game.py`)
- Menu Screens → Text Rendering: renders text (evidence: `view/menu_view.py`)
- Guide Screens → Text Rendering: renders text (evidence: `view/role_view.py`)
- Difficulty Screen → Text Rendering: renders text (evidence: `view/DonNguoiChoi/difficulty_view.py`)
- Player Count Screen → Text Rendering: renders text (evidence: `view/DaNguoiChoi/multi_select_view.py`)
- Solo Game View → Text Rendering: renders text (evidence: `view/DonNguoiChoi/single_game_view.py`)
- Multiplayer View → Text Rendering: renders text (evidence: `view/DaNguoiChoi/multi_game_view.py`)
