# paveiii/plantilla-2025-grupo-a architecture

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

- Interactive diagram: https://gitdiagram.com/paveiii/plantilla-2025-grupo-a
- Repository: https://github.com/paveiii/plantilla-2025-grupo-a

## Overview

##### Project type and purpose
- This is an open-source, single-process, Python-based 2D RPG game built on the Arcade and Pyglet engines, using Tiled maps (via pytiled_parser).
- It provides multiple “views” (main menu, game, battle, inventory, settings, etc.), a turn-based battle system, a world map loader, sprite managers, and JSON-driven data dictionaries for items, effects, characters, and world tiles.

##### File structure
- Top-level directories & files:
- rpg/        ← core Python game package
- resources/  ← all external assets (tilesets, maps, sounds, sprites, data JSON)
- docs/       ← design documents
- setup.py, pyproject.toml, setup.cfg ← build/config
- Within rpg/:
- __main__.py launches the game via Arcade’s Window/View system
- views/ holds all UI/state classes (MainMenuView, GameView, BattleView, etc.)
- sprites/ holds entity classes derived from Arcade.Sprite
- Action.py, Effect.py, EnemyIA.py, BattleAlly.py, BattleEnemy.py, etc. implement game logic and turn-based mechanics
- load_game_map.py handles parsing Tiled maps through pytiled_parser
- save/load is JSON-based via saveGame*.json files
- External libs: Arcade (rendering & windowing), Pyglet (sound), pytiled_parser (map loading).

##### Key insights from README
- It’s an early-stage open-source RPG.
- Uses Arcade/Pyglet/pytiled_parser.
- Scenes & game states are managed as Arcade Views.
- Assets are managed outside the code in JSON and Tiled formats.

##### Detail without overthinking
- Break the game into as many logical pieces as you see in the file tree (each View, each major logic module, resource directories).
- Essential flows: user input → view → logic → model updates → rendering.
- External libraries as separate nodes to show dependencies.
- Static resource folder feeding into the loader classes.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Engine Layer
    subgraph "Engine Layer"
        direction TB
        AW["Arcade Window & View Manager"]:::engine
        PA["Pyglet Audio Subsystem"]:::engine
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        MMV["MainMenuView"]:::presentation
        LV["LoadingView"]:::presentation
        LGV["LoadGameView"]:::presentation
        GV["GameView"]:::presentation
        BV["BattleView"]:::presentation
        IBV["InBattleView"]:::presentation
        AIBV["ActivateInBattleView"]:::presentation
        IV["InventoryView"]:::presentation
        SV["SettingsView"]:::presentation
        CV["CreditsView"]:::presentation
        GOV["GameOverView"]:::presentation
        MVW["MenuView"]:::presentation
    end

    %% Logic Layer
    subgraph "Game Logic Layer"
        direction TB
        AC["Action Controller"]:::logic
        EH["Effect Handler"]:::logic
        BA["BattleAlly Logic"]:::logic
        BE["BattleEnemy Logic"]:::logic
        BB["BattleBuddy Logic"]:::logic
        AI["Enemy AI"]:::logic
    end

    %% Model & Bridge Layer
    subgraph "Model & Sprite Managers"
        direction TB
        PS["PlayerSprite"]:::model
        CS["CharacterSprite"]:::model
        PFS["PathFollowingSprite"]:::model
        RWS["RandomWalkingSprite"]:::model
        WA["WorldAlly"]:::model
        WE["WorldEnemy"]:::model
        WB["WorldBoss"]:::model
        WI["WorldItem"]:::model
        ML["Map Loader"]:::model
        CT["Constants & Config"]:::model
        MB["MessageBox Widget"]:::model
        DB["DrawBar Widget"]:::model
    end

    %% Data Layer
    subgraph "Resource/Data Layer"
        direction TB
        JD["JSON Data Dictionaries"]:::data
        TM["Tiled Maps"]:::data
        TS["Tilesets"]:::data
        AR["Art Assets"]:::data
        SD["Sound Assets"]:::data
        UIA["UI Assets"]:::data
    end

    %% Save/Load Subsystem
    SGS["Save/Load (JSON)"]:::data

    %% Build & Deployment
    subgraph "Build & Deployment"
        direction TB
        SP["setup.py / setup.cfg"]:::external
        PT["pyproject.toml"]:::external
        DOCS["docs/"]:::external
    end

    %% Relationships
    AW -->|"hosts"| MMV
    AW -->|"hosts"| LV
    AW -->|"hosts"| LGV
    AW -->|"hosts"| GV
    AW -->|"hosts"| BV
    AW -->|"hosts"| IBV
    AW -->|"hosts"| AIBV
    AW -->|"hosts"| IV
    AW -->|"hosts"| SV
    AW -->|"hosts"| CV
    AW -->|"hosts"| GOV
    AW -->|"hosts"| MVW

    PA -->|"plays audio"| IV
    PA -->|"plays audio"| BV

    MMV -->|"calls"| AC
    LV -->|"loads resources via"| ML
    LGV -->|"loads save via"| SGS
    GV -->|"renders map via"| ML
    BV -->|"orchestrates"| AC
    BV -->|"applies effects via"| EH

    AC -->|"updates"| PS
    EH -->|"updates"| PS
    BA -->|"controls"| WA
    BE -->|"controls"| WE
    BB -->|"controls"| WB
    AI -->|"drives"| WE

    PS -->|"renders"| GV
    CS -->|"renders"| GV
    PFS -->|"moves"| WA
    RWS -->|"moves"| WE
    WA -->|"placed on map"| ML
    WE -->|"placed on map"| ML
    WB -->|"placed on map"| ML
    WI -->|"placed on map"| ML

    ML -->|"loads from"| TM
    CT -->|"configures loader"| ML

    JD -->|"feeds"| AC
    JD -->|"feeds"| EH

    TM -->|"used by"| ML
    TS -->|"used by"| ML
    AR -->|"used by"| PS
    SD -->|"used by"| PA
    UIA -->|"used by"| MVW

    SGS -->|"serializes"| PS
    SGS -->|"serializes"| WA

    SP -->|"packages"| AW
    PT -->|"packages"| AW
    DOCS -->|"describes"| AW

    %% Click Events
    click AW "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/__main__.py"
    click MMV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/main_menu_view.py"
    click LV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/loading_view.py"
    click LGV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/load_game_view.py"
    click GV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/game_view.py"
    click BV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/battle_view.py"
    click IBV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/in_battle_view.py"
    click AIBV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/activate_in_battle_view.py"
    click IV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/inventory_view.py"
    click SV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/settings_view.py"
    click CV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/credits_view.py"
    click GOV "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/game_over_view.py"
    click MVW "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/views/menu_view.py"
    click PS "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/sprites/player_sprite.py"
    click CS "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/sprites/character_sprite.py"
    click PFS "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/sprites/path_following_sprite.py"
    click RWS "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/sprites/random_walking_sprite.py"
    click WA "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/sprites/WorldAlly.py"
    click WE "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/sprites/WorldEnemy.py"
    click WB "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/sprites/WorldBoss.py"
    click WI "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/sprites/WorldItem.py"
    click AC "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/Action.py"
    click EH "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/Effect.py"
    click BA "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/BattleAlly.py"
    click BE "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/BattleEnemy.py"
    click BB "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/BattleBuddy.py"
    click AI "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/EnemyIA.py"
    click ML "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/load_game_map.py"
    click CT "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/constants.py"
    click MB "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/message_box.py"
    click DB "https://github.com/paveiii/plantilla-2025-grupo-a/blob/main/rpg/draw_bar.py"

    %% Styles
    classDef engine fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef presentation fill:#90EE90,stroke:#000,stroke-width:1px
    classDef logic fill:#FFFF99,stroke:#000,stroke-width:1px
    classDef model fill:#FFA500,stroke:#000,stroke-width:1px
    classDef data fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef external fill:#f0f0f0,stroke:#000,stroke-width:1px
```
