# cbagh0819-ctrl/kill-the-fly-neural-hunter architecture

> Architecture diagram of the GitHub repository cbagh0819-ctrl/kill-the-fly-neural-hunter, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cbagh0819-ctrl/kill-the-fly-neural-hunter
- Repository: https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter

## Overview

KILL THE FLY: Neural Hunter is a browser-based 3D first-person shooter, also packaged as an Android WebView game. The player launches the game, moves and aims through the forest, then hunts flies using an eight-tier arsenal and level-unlocked spells; fly behavior is driven by a connectome-inspired brain model and exposed through a telemetry HUD. The graph covers the main gameplay domains and the Android host. Several subsystem connections are inferred from product documentation rather than shown in the sampled excerpts, so those links are dashed.

Main entry points: [`js/game.js`](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/game.js) (Game Engine), [`js/fly.js`](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/fly.js) (Fly Entity), [`index.html`](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/index.html) (Game Page), [`js/magic.js`](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/magic.js) (Spell System)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game Runtime"]
  node_engine["Game Engine<br/>[game.js]"]
  node_audio["Sound System<br/>[audio.js]"]
end

subgraph group_world["World and Combat"]
  node_forest["Forest Environment<br/>[forest.js]"]
  node_weapons["Weapon System<br/>[weapons.js]"]
  node_magic["Spell System<br/>[magic.js]"]
end

subgraph group_neuro["Fly Neurobiology"]
  node_fly["Fly Entity<br/>[fly.js]"]
  node_brain["Fly Brain<br/>[flyBrain.js]"]
  node_hud["Neural HUD<br/>[neuralHUD.js]"]
end

subgraph group_platform["Player Interfaces"]
  node_webpage["Game Page<br/>[index.html]"]
  node_android["Android Host<br/>[MainActivity.java]"]
end

node_player(("Player"))

node_player -->|"launches"| node_webpage
node_android -->|"loads asset"| node_webpage
node_webpage -.->|"runs game"| node_engine
node_player -.->|"controls"| node_engine
node_engine -->|"spawns"| node_fly
node_fly -->|"constructs"| node_brain
node_fly -->|"uses output"| node_brain
node_engine -->|"creates"| node_hud
node_engine -.->|"manages levels"| node_forest
node_engine -.->|"uses arsenal"| node_weapons
node_engine -.->|"offers spells"| node_magic
node_engine -.->|"uses audio"| node_audio
node_magic -->|"plays effects"| node_audio

click node_webpage "https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/index.html"
click node_android "https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/android-project/src/com/chandanbagh/killthefly/MainActivity.java"
click node_engine "https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/game.js"
click node_forest "https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/forest.js"
click node_weapons "https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/weapons.js"
click node_magic "https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/magic.js"
click node_audio "https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/audio.js"
click node_fly "https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/fly.js"
click node_brain "https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/flyBrain.js"
click node_hud "https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/neuralHUD.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_engine,node_audio toneBlue
class node_forest,node_weapons,node_magic toneAmber
class node_fly,node_brain,node_hud toneMint
class node_webpage,node_android toneRose
class node_player toneIndigo
```

## Components

### Game Runtime

- [Game Engine](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/game.js): `js/game.js`
- [Sound System](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/audio.js): `js/audio.js`

### World and Combat

- [Forest Environment](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/forest.js): `js/forest.js`
- [Weapon System](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/weapons.js): `js/weapons.js`
- [Spell System](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/magic.js): `js/magic.js`

### Fly Neurobiology

- [Fly Entity](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/fly.js): `js/fly.js`
- [Fly Brain](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/flyBrain.js): `js/flyBrain.js`
- [Neural HUD](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/js/neuralHUD.js): `js/neuralHUD.js`

### Player Interfaces

- [Game Page](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/index.html): `index.html`
- [Android Host](https://github.com/cbagh0819-ctrl/kill-the-fly-neural-hunter/blob/master/android-project/src/com/chandanbagh/killthefly/MainActivity.java): `android-project/src/com/chandanbagh/killthefly/MainActivity.java`

### Other components

- **Player**

## Connections

- Player → Game Page: launches (evidence: `README.md`)
- Android Host → Game Page: loads asset (evidence: `android-project/src/com/chandanbagh/killthefly/MainActivity.java`)
- Game Page → Game Engine: runs game
- Player → Game Engine: controls
- Game Engine → Fly Entity: spawns (evidence: `js/game.js`)
- Fly Entity → Fly Brain: constructs (evidence: `js/fly.js`)
- Fly Entity → Fly Brain: uses output (evidence: `js/fly.js`)
- Game Engine → Neural HUD: creates (evidence: `js/game.js`)
- Game Engine → Forest Environment: manages levels
- Game Engine → Weapon System: uses arsenal
- Game Engine → Spell System: offers spells
- Game Engine → Sound System: uses audio
- Spell System → Sound System: plays effects (evidence: `js/magic.js`)
