# murilohirata/breaking-systems architecture

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

- Interactive diagram: https://gitdiagram.com/murilohirata/breaking-systems
- Repository: https://github.com/murilohirata/breaking-systems

## Overview

Breaking Systems is a browser-based 2D platform-combat game. The player starts from the menu, configures controls or difficulty if desired, and fights through file extraction, operating-system security, and BIOS/boss stages to the final challenge. The main script coordinates input, game state, stage progression, rendering, and gameplay modules. The README documents the broader game features; some integration details are inferred only where the sampled excerpts do not show the relevant call sites.

Main entry points: [`js/main.js`](https://github.com/murilohirata/breaking-systems/blob/main/js/main.js) (Game Coordinator), [`js/levels.js`](https://github.com/murilohirata/breaking-systems/blob/main/js/levels.js) (Stage Definitions), [`js/enemy.js`](https://github.com/murilohirata/breaking-systems/blob/main/js/enemy.js) (Enemy Combat), [`js/player.js`](https://github.com/murilohirata/breaking-systems/blob/main/js/player.js) (Player Mechanics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_main["Game Coordinator<br/>[main.js]"]
  node_state["Game State<br/>[gameState.js]"]
end

subgraph group_gameplay["Gameplay"]
  node_playerlogic["Player Mechanics<br/>[player.js]"]
  node_enemies["Enemy Combat<br/>[enemy.js]"]
  node_collision["Collision Rules<br/>[collision.js]"]
end

subgraph group_world["Stages and Assets"]
  node_stages["Stage Definitions<br/>[levels.js]"]
  node_phase1["File Extraction<br/>[levels.js]"]
  node_phase2["OS Security<br/>[levels.js]"]
  node_phase3["BIOS Challenge<br/>[levels.js]"]
  node_assets["Game Assets"]
end

subgraph group_config["Settings"]
  node_settings["Settings Logic<br/>[settings.js]"]
end

node_player(("Player"))
node_browser["Browser Canvas<br/>[index.html]"]
node_storage[("Browser Storage")]

node_player -->|"plays in"| node_browser
node_browser -->|"loads game"| node_main
node_main -->|"creates and updates"| node_state
node_main -->|"loads and saves"| node_settings
node_settings -->|"reads and writes"| node_storage
node_main -->|"updates and renders"| node_playerlogic
node_main -->|"creates, updates, renders"| node_enemies
node_main -->|"creates stage data"| node_stages
node_stages -->|"creates enemies"| node_enemies
node_playerlogic -->|"resolves platforms"| node_collision
node_enemies -->|"resolves hitboxes"| node_collision
node_main -->|"checks attacks"| node_collision
node_stages -->|"defines"| node_phase1
node_stages -->|"defines"| node_phase2
node_stages -->|"defines"| node_phase3
node_main -->|"loads and renders"| node_assets
node_playerlogic -->|"renders player image"| node_assets
node_enemies -->|"renders enemy images"| node_assets
node_main -->|"draws game"| node_browser

click node_browser "https://github.com/murilohirata/breaking-systems/blob/main/index.html"
click node_main "https://github.com/murilohirata/breaking-systems/blob/main/js/main.js"
click node_state "https://github.com/murilohirata/breaking-systems/blob/main/js/gameState.js"
click node_playerlogic "https://github.com/murilohirata/breaking-systems/blob/main/js/player.js"
click node_enemies "https://github.com/murilohirata/breaking-systems/blob/main/js/enemy.js"
click node_collision "https://github.com/murilohirata/breaking-systems/blob/main/js/collision.js"
click node_stages "https://github.com/murilohirata/breaking-systems/blob/main/js/levels.js"
click node_phase1 "https://github.com/murilohirata/breaking-systems/blob/main/js/levels.js"
click node_phase2 "https://github.com/murilohirata/breaking-systems/blob/main/js/levels.js"
click node_phase3 "https://github.com/murilohirata/breaking-systems/blob/main/js/levels.js"
click node_assets "https://github.com/murilohirata/breaking-systems/tree/main/assets"
click node_settings "https://github.com/murilohirata/breaking-systems/blob/main/js/settings.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_main,node_state,node_browser toneBlue
class node_playerlogic,node_enemies,node_collision,node_storage toneAmber
class node_stages,node_phase1,node_phase2,node_phase3,node_assets toneMint
class node_settings toneRose
class node_player toneIndigo
```

## Components

### Game Runtime

- [Game Coordinator](https://github.com/murilohirata/breaking-systems/blob/main/js/main.js): `js/main.js`
- [Game State](https://github.com/murilohirata/breaking-systems/blob/main/js/gameState.js): `js/gameState.js`

### Gameplay

- [Player Mechanics](https://github.com/murilohirata/breaking-systems/blob/main/js/player.js): `js/player.js`
- [Enemy Combat](https://github.com/murilohirata/breaking-systems/blob/main/js/enemy.js): `js/enemy.js`
- [Collision Rules](https://github.com/murilohirata/breaking-systems/blob/main/js/collision.js): `js/collision.js`

### Stages and Assets

- [Stage Definitions](https://github.com/murilohirata/breaking-systems/blob/main/js/levels.js): `js/levels.js`
- [File Extraction](https://github.com/murilohirata/breaking-systems/blob/main/js/levels.js): `js/levels.js`
- [OS Security](https://github.com/murilohirata/breaking-systems/blob/main/js/levels.js): `js/levels.js`
- [BIOS Challenge](https://github.com/murilohirata/breaking-systems/blob/main/js/levels.js): `js/levels.js`
- [Game Assets](https://github.com/murilohirata/breaking-systems/tree/main/assets): `assets`

### Settings

- [Settings Logic](https://github.com/murilohirata/breaking-systems/blob/main/js/settings.js): `js/settings.js`

### Other components

- **Player**
- [Browser Canvas](https://github.com/murilohirata/breaking-systems/blob/main/index.html): `index.html`
- **Browser Storage**

## Connections

- Player → Browser Canvas: plays in
- Browser Canvas → Game Coordinator: loads game
- Game Coordinator → Game State: creates and updates
- Game Coordinator → Settings Logic: loads and saves
- Settings Logic → Browser Storage: reads and writes
- Game Coordinator → Player Mechanics: updates and renders
- Game Coordinator → Enemy Combat: creates, updates, renders
- Game Coordinator → Stage Definitions: creates stage data
- Stage Definitions → Enemy Combat: creates enemies
- Player Mechanics → Collision Rules: resolves platforms
- Enemy Combat → Collision Rules: resolves hitboxes
- Game Coordinator → Collision Rules: checks attacks
- Stage Definitions → File Extraction: defines
- Stage Definitions → OS Security: defines
- Stage Definitions → BIOS Challenge: defines
- Game Coordinator → Game Assets: loads and renders
- Player Mechanics → Game Assets: renders player image
- Enemy Combat → Game Assets: renders enemy images
- Game Coordinator → Browser Canvas: draws game
