# yhsome/bignaiwa architecture

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

- Interactive diagram: https://gitdiagram.com/yhsome/bignaiwa
- Repository: https://github.com/yhsome/bignaiwa

## Overview

合成大奶娃 is an offline-capable browser game: players aim and drop fruit, collisions merge matching tiers into higher fruit, and score/revival effects lead to a danger-line game-over check. The main runtime is concentrated in game.js, which also handles rendering, controls, sprites, and audio; the page and styles provide its interface. A documented rolling leaderboard and static sponsor dialog extend the game. The leaderboard implementation is absent from the supplied tree, so its adapter is shown with no source path; its documented behavior is cited from the README.

Main entry points: [`game.js`](https://github.com/yhsome/bignaiwa/blob/main/game.js) (Physics and Merge), [`index.html`](https://github.com/yhsome/bignaiwa/blob/main/index.html) (Game Page), [`assets/fruits/parts.js`](https://github.com/yhsome/bignaiwa/blob/main/assets/fruits/parts.js) (Collision Shapes), [`assets/fruits/blur.js`](https://github.com/yhsome/bignaiwa/blob/main/assets/fruits/blur.js) (Blur Placeholders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game Runtime"]
  node_controls["Aim and Drop<br/>[game.js]"]
  node_physics["Physics and Merge<br/>[game.js]"]
  node_score["Score and Revive<br/>[game.js]"]
  node_gameover["Game Over Check<br/>[game.js]"]
  node_renderer["Canvas Renderer<br/>[game.js]"]
  node_sprites["Fruit Sprites<br/>[game.js]"]
  node_parts["Collision Shapes<br/>[parts.js]"]
  node_blur["Blur Placeholders<br/>[blur.js]"]
  node_audio["Sound Effects<br/>[game.js]"]
end

subgraph group_interface["Game Interface"]
  node_page["Game Page<br/>[index.html]"]
  node_styles["Responsive UI<br/>[style.css]"]
end

subgraph group_extras["Player Extras"]
  node_board["Leaderboard Adapter"]
  node_sponsor["Sponsor Dialog<br/>[sponsor.js]"]
end

node_player(("Player"))
node_tinywebdb[("TinyWebDB")]

node_player -->|"aims and drops"| node_controls
node_controls -.->|"adds fruit"| node_physics
node_physics -->|"merges and scores"| node_score
node_physics -.->|"checks danger"| node_gameover
node_physics -.->|"uses shapes"| node_parts
node_renderer -.->|"draws fruit"| node_sprites
node_sprites -.->|"falls back to"| node_blur
node_page -.->|"hosts game"| node_controls
node_page -.->|"uses styles"| node_styles
node_gameover -->|"notifies score"| node_board
node_board -.->|"reads and writes"| node_tinywebdb
node_player -.->|"opens dialog"| node_sponsor
node_physics -.->|"plays merge sound"| node_audio

click node_page "https://github.com/yhsome/bignaiwa/blob/main/index.html"
click node_styles "https://github.com/yhsome/bignaiwa/blob/main/style.css"
click node_controls "https://github.com/yhsome/bignaiwa/blob/main/game.js"
click node_physics "https://github.com/yhsome/bignaiwa/blob/main/game.js"
click node_score "https://github.com/yhsome/bignaiwa/blob/main/game.js"
click node_gameover "https://github.com/yhsome/bignaiwa/blob/main/game.js"
click node_renderer "https://github.com/yhsome/bignaiwa/blob/main/game.js"
click node_sprites "https://github.com/yhsome/bignaiwa/blob/main/game.js"
click node_parts "https://github.com/yhsome/bignaiwa/blob/main/assets/fruits/parts.js"
click node_blur "https://github.com/yhsome/bignaiwa/blob/main/assets/fruits/blur.js"
click node_audio "https://github.com/yhsome/bignaiwa/blob/main/game.js"
click node_sponsor "https://github.com/yhsome/bignaiwa/blob/main/sponsor.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_controls,node_physics,node_score,node_gameover,node_renderer,node_sprites,node_parts,node_blur,node_audio toneBlue
class node_page,node_styles,node_tinywebdb toneAmber
class node_board,node_sponsor toneMint
class node_player toneIndigo
```

## Components

### Game Runtime

- [Aim and Drop](https://github.com/yhsome/bignaiwa/blob/main/game.js): `game.js`
- [Physics and Merge](https://github.com/yhsome/bignaiwa/blob/main/game.js): `game.js`
- [Score and Revive](https://github.com/yhsome/bignaiwa/blob/main/game.js): `game.js`
- [Game Over Check](https://github.com/yhsome/bignaiwa/blob/main/game.js): `game.js`
- [Canvas Renderer](https://github.com/yhsome/bignaiwa/blob/main/game.js): `game.js`
- [Fruit Sprites](https://github.com/yhsome/bignaiwa/blob/main/game.js): `game.js`
- [Collision Shapes](https://github.com/yhsome/bignaiwa/blob/main/assets/fruits/parts.js): `assets/fruits/parts.js`
- [Blur Placeholders](https://github.com/yhsome/bignaiwa/blob/main/assets/fruits/blur.js): `assets/fruits/blur.js`
- [Sound Effects](https://github.com/yhsome/bignaiwa/blob/main/game.js): `game.js`

### Game Interface

- [Game Page](https://github.com/yhsome/bignaiwa/blob/main/index.html): `index.html`
- [Responsive UI](https://github.com/yhsome/bignaiwa/blob/main/style.css): `style.css`

### Player Extras

- **Leaderboard Adapter**
- [Sponsor Dialog](https://github.com/yhsome/bignaiwa/blob/main/sponsor.js): `sponsor.js`

### Other components

- **Player**
- **TinyWebDB**

## Connections

- Player → Aim and Drop: aims and drops (evidence: `README.md`)
- Aim and Drop → Physics and Merge: adds fruit (evidence: `game.js`)
- Physics and Merge → Score and Revive: merges and scores (evidence: `game.js`)
- Physics and Merge → Game Over Check: checks danger (evidence: `README.md`)
- Physics and Merge → Collision Shapes: uses shapes (evidence: `README.md`)
- Canvas Renderer → Fruit Sprites: draws fruit (evidence: `README.md`)
- Fruit Sprites → Blur Placeholders: falls back to (evidence: `README.md`)
- Game Page → Aim and Drop: hosts game (evidence: `README.md`)
- Game Page → Responsive UI: uses styles (evidence: `README.md`)
- Game Over Check → Leaderboard Adapter: notifies score (evidence: `game.js`)
- Leaderboard Adapter → TinyWebDB: reads and writes (evidence: `README.md`)
- Player → Sponsor Dialog: opens dialog (evidence: `README.md`)
- Physics and Merge → Sound Effects: plays merge sound (evidence: `README.md`)
