# demonincg/dodecadragons architecture

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

- Interactive diagram: https://gitdiagram.com/demonincg/dodecadragons
- Repository: https://github.com/demonincg/dodecadragons

## Overview

DodecaDragons is a browser-based incremental game. Players use the game interface to gather resources, buy upgrades, unlock successive systems, and perform resets that exchange progress for higher-tier resources and persistent bonuses. The scripts divide progression across resource and prestige systems, while the main script maintains shared game state and computes resource production. The README gives only the title, and sampled excerpts are partial; later-stage capability nodes reflect the source tree, but uncertain connections between systems are omitted.

Main entry points: [`scripts/script.js`](https://github.com/demonincg/dodecadragons/blob/main/scripts/script.js) (Game state and production), [`index.html`](https://github.com/demonincg/dodecadragons/blob/main/index.html) (Game page), [`scripts/magic.js`](https://github.com/demonincg/dodecadragons/blob/main/scripts/magic.js) (Magic and resets), [`scripts/sigils.js`](https://github.com/demonincg/dodecadragons/blob/main/scripts/sigils.js) (Sigils and resets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Game runtime"]
  node_page["Game page<br/>[index.html]"]
  node_runtime["Game state and production<br/>[script.js]"]
  node_render["Pan and render<br/>[render.js]"]
  node_decimal["Large-number arithmetic<br/>[break_eternity.js]"]
end

subgraph group_early["Early progression"]
  node_gold["Gold and miners<br/>[gold.js]"]
  node_fire["Fire upgrades<br/>[fire.js]"]
  node_alchemy["Alchemy resources<br/>[alchemy.js]"]
end

subgraph group_prestige["Prestige systems"]
  node_magic["Magic and resets<br/>[magic.js]"]
  node_challenges["Magic challenges<br/>[magicChallenges.js]"]
  node_sigils["Sigils and resets<br/>[sigils.js]"]
  node_holy["Holy polyhedrons<br/>[holyPolyhedrons.js]"]
  node_dragon["Dragons and time<br/>[dragon.js]"]
end

subgraph group_late["Advanced systems"]
  node_knowledge["Knowledge trades<br/>[knowledge.js]"]
  node_blood["Blood progression<br/>[blood.js]"]
  node_plague["Plague progression<br/>[plague.js]"]
  node_planets["Planets and clusters<br/>[planets.js]"]
  node_nuclear["Nuclear pasta<br/>[nuclearPasta.js]"]
  node_essence["Essences and finality<br/>[essence.js]"]
  node_achievements["Achievements<br/>[achievements.js]"]
end

node_player(("Player"))

node_player -->|"plays"| node_page
node_page -->|"loads interface"| node_runtime
node_page -->|"loads controls"| node_render
node_runtime -->|"uses arithmetic"| node_decimal
node_runtime -->|"computes production"| node_gold
node_runtime -->|"computes production"| node_fire
node_runtime -->|"computes production"| node_alchemy
node_runtime -->|"computes production"| node_magic
node_runtime -->|"updates game view"| node_render
node_magic -->|"unlocks progression"| node_sigils
node_magic -->|"unlocks challenges"| node_challenges
node_sigils -->|"resets resources"| node_holy
node_dragon -->|"updates game state"| node_runtime
node_knowledge -->|"updates game state"| node_runtime
node_blood -->|"updates game state"| node_runtime
node_plague -->|"updates game state"| node_runtime
node_planets -->|"updates game state"| node_runtime
node_nuclear -->|"updates game state"| node_runtime
node_essence -->|"updates game state"| node_runtime
node_achievements -->|"uses game state"| node_runtime

click node_page "https://github.com/demonincg/dodecadragons/blob/main/index.html"
click node_runtime "https://github.com/demonincg/dodecadragons/blob/main/scripts/script.js"
click node_render "https://github.com/demonincg/dodecadragons/blob/main/scripts/render.js"
click node_decimal "https://github.com/demonincg/dodecadragons/blob/main/scripts/break_eternity.js"
click node_gold "https://github.com/demonincg/dodecadragons/blob/main/scripts/gold.js"
click node_fire "https://github.com/demonincg/dodecadragons/blob/main/scripts/fire.js"
click node_alchemy "https://github.com/demonincg/dodecadragons/blob/main/scripts/alchemy.js"
click node_magic "https://github.com/demonincg/dodecadragons/blob/main/scripts/magic.js"
click node_challenges "https://github.com/demonincg/dodecadragons/blob/main/scripts/magicChallenges.js"
click node_sigils "https://github.com/demonincg/dodecadragons/blob/main/scripts/sigils.js"
click node_holy "https://github.com/demonincg/dodecadragons/blob/main/scripts/holyPolyhedrons.js"
click node_dragon "https://github.com/demonincg/dodecadragons/blob/main/scripts/dragon.js"
click node_knowledge "https://github.com/demonincg/dodecadragons/blob/main/scripts/knowledge.js"
click node_blood "https://github.com/demonincg/dodecadragons/blob/main/scripts/blood.js"
click node_plague "https://github.com/demonincg/dodecadragons/blob/main/scripts/plague.js"
click node_planets "https://github.com/demonincg/dodecadragons/blob/main/scripts/planets.js"
click node_nuclear "https://github.com/demonincg/dodecadragons/blob/main/scripts/nuclearPasta.js"
click node_essence "https://github.com/demonincg/dodecadragons/blob/main/scripts/essence.js"
click node_achievements "https://github.com/demonincg/dodecadragons/blob/main/scripts/achievements.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_runtime,node_render,node_decimal toneBlue
class node_gold,node_fire,node_alchemy toneAmber
class node_magic,node_challenges,node_sigils,node_holy,node_dragon toneMint
class node_knowledge,node_blood,node_plague,node_planets,node_nuclear,node_essence,node_achievements toneRose
class node_player toneIndigo
```

## Components

### Game runtime

- [Game page](https://github.com/demonincg/dodecadragons/blob/main/index.html): `index.html`
- [Game state and production](https://github.com/demonincg/dodecadragons/blob/main/scripts/script.js): `scripts/script.js`
- [Pan and render](https://github.com/demonincg/dodecadragons/blob/main/scripts/render.js): `scripts/render.js`
- [Large-number arithmetic](https://github.com/demonincg/dodecadragons/blob/main/scripts/break_eternity.js): `scripts/break_eternity.js`

### Early progression

- [Gold and miners](https://github.com/demonincg/dodecadragons/blob/main/scripts/gold.js): `scripts/gold.js`
- [Fire upgrades](https://github.com/demonincg/dodecadragons/blob/main/scripts/fire.js): `scripts/fire.js`
- [Alchemy resources](https://github.com/demonincg/dodecadragons/blob/main/scripts/alchemy.js): `scripts/alchemy.js`

### Prestige systems

- [Magic and resets](https://github.com/demonincg/dodecadragons/blob/main/scripts/magic.js): `scripts/magic.js`
- [Magic challenges](https://github.com/demonincg/dodecadragons/blob/main/scripts/magicChallenges.js): `scripts/magicChallenges.js`
- [Sigils and resets](https://github.com/demonincg/dodecadragons/blob/main/scripts/sigils.js): `scripts/sigils.js`
- [Holy polyhedrons](https://github.com/demonincg/dodecadragons/blob/main/scripts/holyPolyhedrons.js): `scripts/holyPolyhedrons.js`
- [Dragons and time](https://github.com/demonincg/dodecadragons/blob/main/scripts/dragon.js): `scripts/dragon.js`

### Advanced systems

- [Knowledge trades](https://github.com/demonincg/dodecadragons/blob/main/scripts/knowledge.js): `scripts/knowledge.js`
- [Blood progression](https://github.com/demonincg/dodecadragons/blob/main/scripts/blood.js): `scripts/blood.js`
- [Plague progression](https://github.com/demonincg/dodecadragons/blob/main/scripts/plague.js): `scripts/plague.js`
- [Planets and clusters](https://github.com/demonincg/dodecadragons/blob/main/scripts/planets.js): `scripts/planets.js`
- [Nuclear pasta](https://github.com/demonincg/dodecadragons/blob/main/scripts/nuclearPasta.js): `scripts/nuclearPasta.js`
- [Essences and finality](https://github.com/demonincg/dodecadragons/blob/main/scripts/essence.js): `scripts/essence.js`
- [Achievements](https://github.com/demonincg/dodecadragons/blob/main/scripts/achievements.js): `scripts/achievements.js`

### Other components

- **Player**

## Connections

- Player → Game page: plays
- Game page → Game state and production: loads interface
- Game page → Pan and render: loads controls
- Game state and production → Large-number arithmetic: uses arithmetic
- Game state and production → Gold and miners: computes production
- Game state and production → Fire upgrades: computes production
- Game state and production → Alchemy resources: computes production
- Game state and production → Magic and resets: computes production
- Game state and production → Pan and render: updates game view
- Magic and resets → Sigils and resets: unlocks progression
- Magic and resets → Magic challenges: unlocks challenges
- Sigils and resets → Holy polyhedrons: resets resources
- Dragons and time → Game state and production: updates game state
- Knowledge trades → Game state and production: updates game state
- Blood progression → Game state and production: updates game state
- Plague progression → Game state and production: updates game state
- Planets and clusters → Game state and production: updates game state
- Nuclear pasta → Game state and production: updates game state
- Essences and finality → Game state and production: updates game state
- Achievements → Game state and production: uses game state
