# lelicorne/super-tetris architecture

> Architecture diagram of the GitHub repository lelicorne/super-tetris, 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/lelicorne/super-tetris
- Repository: https://github.com/lelicorne/super-tetris

## Overview

This repository is a browser-based falling-block game with configurable piece shapes, a board, and power-ups. The player uses keyboard or touch controls; the game updates its state and draws the board and upcoming pieces on canvases. The sampled implementation is a single JavaScript file, so its responsibilities are shown as components sharing that path. The HTML and CSS are present in the tree, but were not sampled; relationships to them are therefore omitted.

Main entry points: [`js/game.js`](https://github.com/lelicorne/super-tetris/blob/main/js/game.js) (Canvas rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Game runtime"]
  node_game_rules["Game rules<br/>[game.js]"]
  node_board_state["Board state<br/>[game.js]"]
  node_powerups["Power-ups<br/>[game.js]"]
end

subgraph group_presentation["Rendering and interface"]
  node_canvas_rendering["Canvas rendering<br/>[game.js]"]
  node_next_piece["Next piece display<br/>[game.js]"]
end

subgraph group_input["Player controls"]
  node_control_bindings["Control bindings<br/>[game.js]"]
end

node_player(("Player"))

node_player -->|"operates"| node_control_bindings
node_control_bindings -->|"runs actions"| node_game_rules
node_canvas_rendering -->|"draws state"| node_board_state
node_canvas_rendering -->|"draws powers"| node_powerups
node_next_piece -->|"draws queue"| node_game_rules

click node_game_rules "https://github.com/lelicorne/super-tetris/blob/main/js/game.js"
click node_board_state "https://github.com/lelicorne/super-tetris/blob/main/js/game.js"
click node_powerups "https://github.com/lelicorne/super-tetris/blob/main/js/game.js"
click node_canvas_rendering "https://github.com/lelicorne/super-tetris/blob/main/js/game.js"
click node_next_piece "https://github.com/lelicorne/super-tetris/blob/main/js/game.js"
click node_control_bindings "https://github.com/lelicorne/super-tetris/blob/main/js/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_game_rules,node_board_state,node_powerups toneBlue
class node_canvas_rendering,node_next_piece toneAmber
class node_control_bindings toneMint
class node_player toneIndigo
```

## Components

### Game runtime

- [Game rules](https://github.com/lelicorne/super-tetris/blob/main/js/game.js): `js/game.js`
- [Board state](https://github.com/lelicorne/super-tetris/blob/main/js/game.js): `js/game.js`
- [Power-ups](https://github.com/lelicorne/super-tetris/blob/main/js/game.js): `js/game.js`

### Rendering and interface

- [Canvas rendering](https://github.com/lelicorne/super-tetris/blob/main/js/game.js): `js/game.js`
- [Next piece display](https://github.com/lelicorne/super-tetris/blob/main/js/game.js): `js/game.js`

### Player controls

- [Control bindings](https://github.com/lelicorne/super-tetris/blob/main/js/game.js): `js/game.js`

### Other components

- **Player**

## Connections

- Player → Control bindings: operates (evidence: `js/game.js`)
- Control bindings → Game rules: runs actions (evidence: `js/game.js`)
- Canvas rendering → Board state: draws state (evidence: `js/game.js`)
- Canvas rendering → Power-ups: draws powers (evidence: `js/game.js`)
- Next piece display → Game rules: draws queue (evidence: `js/game.js`)
