# wiliovi/claude-tetris architecture

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

- Interactive diagram: https://gitdiagram.com/wiliovi/claude-tetris
- Repository: https://github.com/wiliovi/claude-tetris

## Overview

Es un Tetris clásico para navegador, ejecutado directamente como HTML, CSS y JavaScript sin dependencias. El jugador abre el juego y controla una partida: se generan y mueven piezas, se detectan colisiones, se fijan bloques y se limpian líneas; la puntuación y el nivel progresan mientras el tablero y la interfaz se actualizan. El README documenta el flujo principal; los detalles de habilidades y controles táctiles se apoyan solo en los fragmentos disponibles de `game.js`, por lo que se omiten relaciones internas no demostradas.

Main entry points: [`game.js`](https://github.com/wiliovi/claude-tetris/blob/main/game.js) (Control de partida), [`index.html`](https://github.com/wiliovi/claude-tetris/blob/main/index.html) (Pantalla de juego), [`style.css`](https://github.com/wiliovi/claude-tetris/blob/main/style.css) (Estilo visual)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Interfaz"]
  node_page["Pantalla de juego<br/>[index.html]"]
  node_styles["Estilo visual<br/>[style.css]"]
  node_render["Canvas y vistas previas<br/>[game.js]"]
end

subgraph group_runtime["Partida"]
  node_game["Control de partida<br/>[game.js]"]
  node_loop["Bucle de juego<br/>[game.js]"]
  node_input["Controles<br/>[game.js]"]
  node_states["Pausa y fin<br/>[game.js]"]
end

subgraph group_mechanics["Mecánicas"]
  node_board["Tablero<br/>[game.js]"]
  node_pieces["Piezas y cola<br/>[game.js]"]
  node_collision["Colisiones y giros<br/>[game.js]"]
  node_locking["Fijar y limpiar<br/>[game.js]"]
  node_powerups["Power-ups y habilidades<br/>[game.js]"]
end

subgraph group_progression["Progresión"]
  node_score["Puntuación y líneas<br/>[game.js]"]
  node_levels["Niveles y velocidad<br/>[game.js]"]
end

node_player(("Jugador"))

node_player -->|"abre y juega"| node_page
node_page -->|"presenta el juego"| node_game
node_styles -->|"da estilo"| node_page
node_input -->|"envía acciones"| node_game
node_game -->|"inicializa"| node_board
node_game -->|"genera y avanza"| node_pieces
node_loop -->|"comprueba caída"| node_collision
node_collision -->|"detecta aterrizaje"| node_locking
node_locking -->|"fija bloques"| node_board
node_locking -->|"actualiza líneas"| node_score
node_score -->|"avanza nivel"| node_levels
node_loop -->|"dibuja partida"| node_render
node_render -->|"actualiza canvas"| node_page
node_input -->|"intenta movimientos"| node_collision
node_input -->|"pausa o reinicia"| node_states
node_pieces -.->|"incluye piezas especiales"| node_powerups

click node_page "https://github.com/wiliovi/claude-tetris/blob/main/index.html"
click node_styles "https://github.com/wiliovi/claude-tetris/blob/main/style.css"
click node_game "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_loop "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_input "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_board "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_pieces "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_collision "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_locking "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_powerups "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_render "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_score "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_levels "https://github.com/wiliovi/claude-tetris/blob/main/game.js"
click node_states "https://github.com/wiliovi/claude-tetris/blob/main/game.js"

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_page,node_styles,node_render toneBlue
class node_game,node_loop,node_input,node_states toneAmber
class node_board,node_pieces,node_collision,node_locking,node_powerups toneMint
class node_score,node_levels toneRose
class node_player toneIndigo
```

## Components

### Interfaz

- [Pantalla de juego](https://github.com/wiliovi/claude-tetris/blob/main/index.html): `index.html`
- [Estilo visual](https://github.com/wiliovi/claude-tetris/blob/main/style.css): `style.css`
- [Canvas y vistas previas](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`

### Partida

- [Control de partida](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`
- [Bucle de juego](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`
- [Controles](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`
- [Pausa y fin](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`

### Mecánicas

- [Tablero](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`
- [Piezas y cola](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`
- [Colisiones y giros](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`
- [Fijar y limpiar](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`
- [Power-ups y habilidades](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`

### Progresión

- [Puntuación y líneas](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`
- [Niveles y velocidad](https://github.com/wiliovi/claude-tetris/blob/main/game.js): `game.js`

### Other components

- **Jugador**

## Connections

- Jugador → Pantalla de juego: abre y juega (evidence: `README.md`)
- Pantalla de juego → Control de partida: presenta el juego (evidence: `README.md`)
- Estilo visual → Pantalla de juego: da estilo (evidence: `README.md`)
- Controles → Control de partida: envía acciones (evidence: `README.md`)
- Control de partida → Tablero: inicializa (evidence: `README.md`)
- Control de partida → Piezas y cola: genera y avanza (evidence: `README.md`)
- Bucle de juego → Colisiones y giros: comprueba caída (evidence: `README.md`)
- Colisiones y giros → Fijar y limpiar: detecta aterrizaje (evidence: `README.md`)
- Fijar y limpiar → Tablero: fija bloques (evidence: `README.md`)
- Fijar y limpiar → Puntuación y líneas: actualiza líneas (evidence: `README.md`)
- Puntuación y líneas → Niveles y velocidad: avanza nivel (evidence: `README.md`)
- Bucle de juego → Canvas y vistas previas: dibuja partida (evidence: `README.md`)
- Canvas y vistas previas → Pantalla de juego: actualiza canvas (evidence: `README.md`)
- Controles → Colisiones y giros: intenta movimientos (evidence: `README.md`)
- Controles → Pausa y fin: pausa o reinicia (evidence: `README.md`)
- Piezas y cola → Power-ups y habilidades: incluye piezas especiales (evidence: `game.js`)
