# yang1yangcz/bunny-vs-slime architecture

> Architecture diagram of the GitHub repository yang1yangcz/bunny-vs-slime, 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/yang1yangcz/bunny-vs-slime
- Repository: https://github.com/yang1yangcz/bunny-vs-slime

## Overview

Bounce Duel is a browser-based, real-time 2D arena battle delivered as a standalone HTML file. The principal workflow is opening the page, which runs the battle simulation and presents its live arena, controls, and result. The README documents the combat abilities, damage rules, UI, audio, speech, and debug API; the template is identified as the source of the live page. The template itself was not sampled, so edges describe only documented relationships, not inspected implementation details.

Main entry points: [`bounce-duel/live.template.html`](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html) (Real-time battle loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Battle simulation"]
  node_battle_loop["Real-time battle loop<br/>[live.template.html]"]
  node_rabbit["Rabbit combat<br/>[live.template.html]"]
  node_rabbit_abilities["Rabbit abilities<br/>[live.template.html]"]
  node_slime["Slime combat<br/>[live.template.html]"]
  node_slime_abilities["Slime abilities<br/>[live.template.html]"]
  node_damage_model["Damage and healing<br/>[live.template.html]"]
  node_battle_state["Battle state<br/>[live.template.html]"]
end

subgraph group_presentation["Arena and interface"]
  node_arena["Arena rendering<br/>[live.template.html]"]
  node_hud["HUD and details<br/>[live.template.html]"]
  node_controls["Battle controls<br/>[live.template.html]"]
  node_results["KO and MVP<br/>[live.template.html]"]
end

subgraph group_runtime["Browser runtime"]
  node_live_page["Live duel page<br/>[live.template.html]"]
  node_sound["Synthesized sound<br/>[live.template.html]"]
  node_speech["Voice announcements<br/>[live.template.html]"]
  node_debug_api["Simulation debug API<br/>[live.template.html]"]
end

node_player(("Player"))
node_browser_audio["Web Audio API"]
node_browser_speech["System speech voices"]

node_player -->|"opens"| node_live_page
node_live_page -->|"runs"| node_battle_loop
node_battle_loop -->|"simulates"| node_rabbit
node_battle_loop -->|"simulates"| node_slime
node_rabbit -->|"uses"| node_rabbit_abilities
node_slime -->|"uses"| node_slime_abilities
node_rabbit_abilities -->|"deal damage"| node_damage_model
node_slime_abilities -->|"deal damage"| node_damage_model
node_damage_model -->|"updates"| node_battle_state
node_battle_loop -->|"renders"| node_arena
node_battle_state -->|"shows status"| node_hud
node_controls -->|"resets battle"| node_battle_loop
node_battle_state -->|"determines outcome"| node_results
node_battle_loop -.->|"plays effects"| node_sound
node_sound -->|"uses"| node_browser_audio
node_battle_loop -.->|"announces results"| node_speech
node_speech -->|"uses"| node_browser_speech
node_player -->|"inspects or advances"| node_debug_api
node_debug_api -->|"advances"| node_battle_loop

click node_live_page "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_battle_loop "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_rabbit "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_rabbit_abilities "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_slime "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_slime_abilities "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_damage_model "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_battle_state "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_arena "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_hud "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_controls "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_results "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_sound "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_speech "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"
click node_debug_api "https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html"

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_battle_loop,node_rabbit,node_rabbit_abilities,node_slime,node_slime_abilities,node_damage_model,node_battle_state toneBlue
class node_arena,node_hud,node_controls,node_results toneAmber
class node_live_page,node_sound,node_speech,node_debug_api,node_browser_audio toneMint
class node_player,node_browser_speech toneIndigo
```

## Components

### Battle simulation

- [Real-time battle loop](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [Rabbit combat](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [Rabbit abilities](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [Slime combat](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [Slime abilities](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [Damage and healing](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [Battle state](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`

### Arena and interface

- [Arena rendering](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [HUD and details](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [Battle controls](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [KO and MVP](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`

### Browser runtime

- [Live duel page](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [Synthesized sound](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [Voice announcements](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`
- [Simulation debug API](https://github.com/yang1yangcz/bunny-vs-slime/blob/master/bounce-duel/live.template.html): `bounce-duel/live.template.html`

### Other components

- **Player**
- **Web Audio API**
- **System speech voices**

## Connections

- Player → Live duel page: opens (evidence: `README.md`)
- Live duel page → Real-time battle loop: runs (evidence: `README.md`)
- Real-time battle loop → Rabbit combat: simulates (evidence: `README.md`)
- Real-time battle loop → Slime combat: simulates (evidence: `README.md`)
- Rabbit combat → Rabbit abilities: uses (evidence: `README.md`)
- Slime combat → Slime abilities: uses (evidence: `README.md`)
- Rabbit abilities → Damage and healing: deal damage (evidence: `README.md`)
- Slime abilities → Damage and healing: deal damage (evidence: `README.md`)
- Damage and healing → Battle state: updates (evidence: `README.md`)
- Real-time battle loop → Arena rendering: renders (evidence: `README.md`)
- Battle state → HUD and details: shows status (evidence: `README.md`)
- Battle controls → Real-time battle loop: resets battle (evidence: `README.md`)
- Battle state → KO and MVP: determines outcome (evidence: `README.md`)
- Real-time battle loop → Synthesized sound: plays effects
- Synthesized sound → Web Audio API: uses (evidence: `README.md`)
- Real-time battle loop → Voice announcements: announces results
- Voice announcements → System speech voices: uses (evidence: `README.md`)
- Player → Simulation debug API: inspects or advances (evidence: `README.md`)
- Simulation debug API → Real-time battle loop: advances (evidence: `README.md`)
