# rafanhrayan/bss-webgl architecture

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

- Interactive diagram: https://gitdiagram.com/rafanhrayan/bss-webgl
- Repository: https://github.com/rafanhrayan/bss-webgl

## Overview

Bee Swarm Simulator WebGL Edition is a browser-based JavaScript remake of the game. The broad user path is opening the web page and playing the simulation; the supplied evidence does not expose the main runtime loop, so detailed hand-offs between rendering, gameplay, and interface code cannot be confirmed. The graph preserves the major visible domains: NPC quests and rewards, equipment, world geometry, shader and texture assets, math support, and audio. Some audio behavior is documented in the README, but its implementation is not shown.

Main entry points: [`index.js`](https://github.com/rafanhrayan/bss-webgl/blob/main/index.js) (Player), [`index.html`](https://github.com/rafanhrayan/bss-webgl/blob/main/index.html) (Game page), [`dialogue.js`](https://github.com/rafanhrayan/bss-webgl/blob/main/dialogue.js) (NPC dialogue), [`mapMesh.js`](https://github.com/rafanhrayan/bss-webgl/blob/main/mapMesh.js) (World geometry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_player["Player<br/>[index.js]"]
  node_webpage["Game page<br/>[index.html]"]
end

subgraph group_world["World rendering"]
  node_map["World geometry<br/>[mapMesh.js]"]
  node_shaders["WebGL shaders<br/>[GLSLShaders.js]"]
  node_math["Math utilities<br/>[MathHelper.js]"]
  node_glmatrix["Matrix utilities<br/>[gl-matrix-min.js]"]
end

subgraph group_gameplay["Gameplay systems"]
  node_dialogue["NPC dialogue<br/>[dialogue.js]"]
  node_gear["Player equipment<br/>[playerGear.js]"]
end

subgraph group_assets["Media assets"]
  node_textures["Texture generation<br/>[textures.js]"]
  node_thumbnail["Thumbnail drawing<br/>[thumbnail.js]"]
  node_audio["Game audio"]
end

node_browser(("Player"))

node_browser -->|"opens"| node_webpage
node_dialogue -->|"updates quests"| node_player
node_webpage -.->|"runs game"| node_player
node_player -.->|"renders world"| node_map
node_player -.->|"uses shaders"| node_shaders
node_player -.->|"uses textures"| node_textures
node_player -.->|"plays audio"| node_audio

click node_player "https://github.com/rafanhrayan/bss-webgl/blob/main/index.js"
click node_webpage "https://github.com/rafanhrayan/bss-webgl/blob/main/index.html"
click node_dialogue "https://github.com/rafanhrayan/bss-webgl/blob/main/dialogue.js"
click node_gear "https://github.com/rafanhrayan/bss-webgl/blob/main/playerGear.js"
click node_map "https://github.com/rafanhrayan/bss-webgl/blob/main/mapMesh.js"
click node_shaders "https://github.com/rafanhrayan/bss-webgl/blob/main/GLSLShaders.js"
click node_textures "https://github.com/rafanhrayan/bss-webgl/blob/main/textures.js"
click node_thumbnail "https://github.com/rafanhrayan/bss-webgl/blob/main/thumbnail.js"
click node_math "https://github.com/rafanhrayan/bss-webgl/blob/main/MathHelper.js"
click node_glmatrix "https://github.com/rafanhrayan/bss-webgl/blob/main/resources/gl-matrix-min.js"
click node_audio "https://github.com/rafanhrayan/bss-webgl/tree/main/audio"

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_player,node_webpage toneBlue
class node_map,node_shaders,node_math,node_glmatrix toneAmber
class node_dialogue,node_gear toneMint
class node_textures,node_thumbnail,node_audio toneRose
class node_browser toneIndigo
```

## Components

### Game runtime

- [Player](https://github.com/rafanhrayan/bss-webgl/blob/main/index.js): `index.js`
- [Game page](https://github.com/rafanhrayan/bss-webgl/blob/main/index.html): `index.html`

### World rendering

- [World geometry](https://github.com/rafanhrayan/bss-webgl/blob/main/mapMesh.js): `mapMesh.js`
- [WebGL shaders](https://github.com/rafanhrayan/bss-webgl/blob/main/GLSLShaders.js): `GLSLShaders.js`
- [Math utilities](https://github.com/rafanhrayan/bss-webgl/blob/main/MathHelper.js): `MathHelper.js`
- [Matrix utilities](https://github.com/rafanhrayan/bss-webgl/blob/main/resources/gl-matrix-min.js): `resources/gl-matrix-min.js`

### Gameplay systems

- [NPC dialogue](https://github.com/rafanhrayan/bss-webgl/blob/main/dialogue.js): `dialogue.js`
- [Player equipment](https://github.com/rafanhrayan/bss-webgl/blob/main/playerGear.js): `playerGear.js`

### Media assets

- [Texture generation](https://github.com/rafanhrayan/bss-webgl/blob/main/textures.js): `textures.js`
- [Thumbnail drawing](https://github.com/rafanhrayan/bss-webgl/blob/main/thumbnail.js): `thumbnail.js`
- [Game audio](https://github.com/rafanhrayan/bss-webgl/tree/main/audio): `audio`

### Other components

- **Player**

## Connections

- Player → Game page: opens (evidence: `README.md`)
- NPC dialogue → Player: updates quests (evidence: `dialogue.js`)
- Game page → Player: runs game
- Player → World geometry: renders world
- Player → WebGL shaders: uses shaders
- Player → Texture generation: uses textures
- Player → Game audio: plays audio
