# raulsr92/tallejavascript-videojuegos architecture

> Architecture diagram of the GitHub repository raulsr92/tallejavascript-videojuegos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/raulsr92/tallejavascript-videojuegos
- Repository: https://github.com/raulsr92/tallejavascript-videojuegos

## Overview

##### Project type and purpose
- This is a small, static, browser-based video game built purely with HTML, CSS and JavaScript.
- There is no backend service—everything runs in the client’s browser, using files: HTML for views, CSS for styles, JS for game logic, DOM updates and local storage for high-score records.
- Purpose: deliver an interactive “collect bombs” game with levels, timers, animations, start & end screens, and record keeping.

##### File structure
- index.html – the main entry point that loads the game.
- game.js & gameProfe.js – core game logic; two versions or modules containing movement, collision, fire effect, level progression.
- maps.js – definition of level layouts (maps, coordinates of bombs, walls, player start).
- records.html & records.js & records-style.css – separate “high scores” page showing saved times.
- styles.css & records-style.css – global and record-page styling.
- assets/ – images, sprites, sound effects used by the game.
- .gitignore, LICENSE, README, config folders are standard but not part of runtime.

##### README for additional insights
- Confirms it’s a Platzi workshop project, highlights features: fire on collision, timer with two decimal places, interactive cards, start screen, win animation.
- No external data services—records likely persisted in localStorage.

##### Elements
- Blue for “UI/HTML/CSS components”
- Green for “Game Logic modules”
- Orange for “Data stores (maps, localStorage)”
- Gray for “Assets”

##### Final advice
- Be detailed: break out each JS module into its role (timer, collision, UI overlay).
- Lifecycle: Start Screen → Game Loop → Win/Lose → Record Save → Records Page.
- Interactive elements (keyboard input, timers, animations), even though there’s no server.
- This level of detail ensures any engineer sees exactly how the front-end static game is structured and plays.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Components"
        INDEX["index.html"]:::ui
        RECORDS_PAGE["records.html"]:::ui
    end

    %% Styles
    subgraph "Styles"
        STYLES["styles.css"]:::ui
        RECORD_STYLES["records-style.css"]:::ui
    end

    %% Game Logic Modules
    subgraph "Game Logic Modules"
        GAME["game.js"]:::logic
        GAME_PROF["gameProfe.js"]:::logic
    end

    %% Data Stores
    subgraph "Data Stores"
        MAPS["maps.js"]:::data
        LS["localStorage"]:::data
    end

    %% Assets
    subgraph "Assets"
        ASSETS["assets/ (Images, Sprites, Sounds)"]:::assets
    end

    %% Connections: Game Flow
    INDEX -->|"loads CSS"| STYLES
    INDEX -->|"loads JS modules"| GAME
    INDEX -->|"loads JS modules"| GAME_PROF
    INDEX -->|"loads map definitions"| MAPS

    GAME <-->|"reads/writes definitions"| MAPS
    GAME -->|"fetches assets"| ASSETS
    GAME -->|"saves score"| LS
    GAME -->|"on win/lose navigates"| RECORDS_PAGE

    %% Records Page Flow
    RECORDS_PAGE -->|"loads CSS"| RECORD_STYLES
    RECORDS_PAGE -->|"loads JS"| RECORDS_LOGIC[/"records.js"/]:::logic
    RECORDS_LOGIC -->|"reads/writes"| LS

    %% Styles for game screens and animations
    STYLES -->|"applied to"| INDEX
    RECORD_STYLES -->|"applied to"| RECORDS_PAGE

    %% Click Events
    click INDEX "https://github.com/raulsr92/tallejavascript-videojuegos/blob/main/index.html"
    click GAME "https://github.com/raulsr92/tallejavascript-videojuegos/blob/main/game.js"
    click GAME_PROF "https://github.com/raulsr92/tallejavascript-videojuegos/blob/main/gameProfe.js"
    click MAPS "https://github.com/raulsr92/tallejavascript-videojuegos/blob/main/maps.js"
    click STYLES "https://github.com/raulsr92/tallejavascript-videojuegos/blob/main/styles.css"
    click RECORDS_PAGE "https://github.com/raulsr92/tallejavascript-videojuegos/blob/main/records.html"
    click RECORDS_LOGIC "https://github.com/raulsr92/tallejavascript-videojuegos/blob/main/records.js"
    click RECORD_STYLES "https://github.com/raulsr92/tallejavascript-videojuegos/blob/main/records-style.css"
    click ASSETS "https://github.com/raulsr92/tallejavascript-videojuegos/tree/main/assets/"

    %% Styling
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef logic fill:#90EE90,stroke:#000,stroke-width:1px
    classDef data fill:#FFA500,stroke:#000,stroke-width:1px
    classDef assets fill:#D3D3D3,stroke:#000,stroke-width:1px
```
