# merapalajagadeeshkumar/project-1 architecture

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

- Interactive diagram: https://gitdiagram.com/merapalajagadeeshkumar/project-1
- Repository: https://github.com/merapalajagadeeshkumar/project-1

## Overview

DO OR DIE is a browser-based third-person battle royale: one player parachutes onto an island with 24 AI bots, scavenges equipment, fights, and tries to survive the shrinking safe zone. The browser entry and menu start a match; the game orchestrator prepares the world and match systems, then presents combat status and win/loss results. Major documented capabilities include desktop and mobile controls, weapons and loot, bot AI, safe-zone damage, audio, and settings. Source excerpts are partial, so links for unsampled runtime behavior are limited to README claims.

Main entry points: [`src/main.js`](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/main.js) (Game Runtime), [`src/player.js`](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/player.js) (Player Controller), [`src/constants.js`](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/constants.js) (Game Rules), [`src/bots.js`](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/bots.js) (Bot AI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Browser Entry"]
  node_html["Game Shell<br/>[index.html]"]
end

subgraph group_match["Match Orchestration"]
  node_main["Game Runtime<br/>[main.js]"]
  node_config["Game Rules<br/>[constants.js]"]
end

subgraph group_world["World and Survival"]
  node_map["Island Map<br/>[map.js]"]
  node_zone["Safe Zone<br/>[zone.js]"]
  node_loot["Loot System<br/>[loot.js]"]
end

subgraph group_combat["Combat and Controls"]
  node_bots["Bot AI<br/>[bots.js]"]
  node_weapons["Weapons and Effects<br/>[weapons.js]"]
  node_avatar["Player Controller<br/>[player.js]"]
  node_mobile["Touch Controls<br/>[mobile.js]"]
end

subgraph group_presentation["Player Experience"]
  node_ui["HUD and Results<br/>[ui.js]"]
  node_audio["Sound Engine<br/>[audio.js]"]
end

node_player(("Player"))

node_player -->|"opens"| node_html
node_html -->|"starts"| node_main
node_main -->|"builds"| node_map
node_main -->|"populates"| node_loot
node_main -->|"initializes"| node_weapons
node_main -->|"spawns"| node_bots
node_main -->|"starts parachute"| node_avatar
node_main -->|"updates"| node_ui
node_main -->|"shows results"| node_ui
node_main -->|"starts ambient"| node_audio
node_loot -->|"reads terrain"| node_map
node_bots -->|"finds and removes"| node_loot
node_avatar -->|"checks damage"| node_zone
node_avatar -->|"updates combat HUD"| node_ui
node_mobile -->|"sends controls"| node_avatar
node_config -->|"sets stages"| node_zone
node_config -->|"sets loot count"| node_loot
node_config -->|"sets bot count"| node_bots
node_config -->|"sets weapon stats"| node_weapons
node_player -->|"starts match"| node_main
node_bots -.->|"fights"| node_avatar
node_avatar -.->|"fires weapons"| node_weapons
node_main -.->|"advances phases"| node_zone
node_main -.->|"enables touch controls"| node_mobile

click node_html "https://github.com/merapalajagadeeshkumar/project-1/blob/main/index.html"
click node_main "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/main.js"
click node_config "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/constants.js"
click node_map "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/map.js"
click node_zone "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/zone.js"
click node_loot "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/loot.js"
click node_bots "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/bots.js"
click node_weapons "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/weapons.js"
click node_avatar "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/player.js"
click node_mobile "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/mobile.js"
click node_ui "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/ui.js"
click node_audio "https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/audio.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_html toneBlue
class node_main,node_config toneAmber
class node_map,node_zone,node_loot toneMint
class node_bots,node_weapons,node_avatar,node_mobile toneRose
class node_ui,node_audio,node_player toneIndigo
```

## Components

### Browser Entry

- [Game Shell](https://github.com/merapalajagadeeshkumar/project-1/blob/main/index.html): `index.html`

### Match Orchestration

- [Game Runtime](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/main.js): `src/main.js`
- [Game Rules](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/constants.js): `src/constants.js`

### World and Survival

- [Island Map](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/map.js): `src/map.js`
- [Safe Zone](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/zone.js): `src/zone.js`
- [Loot System](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/loot.js): `src/loot.js`

### Combat and Controls

- [Bot AI](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/bots.js): `src/bots.js`
- [Weapons and Effects](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/weapons.js): `src/weapons.js`
- [Player Controller](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/player.js): `src/player.js`
- [Touch Controls](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/mobile.js): `src/mobile.js`

### Player Experience

- [HUD and Results](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/ui.js): `src/ui.js`
- [Sound Engine](https://github.com/merapalajagadeeshkumar/project-1/blob/main/src/audio.js): `src/audio.js`

### Other components

- **Player**

## Connections

- Player → Game Shell: opens (evidence: `README.md`)
- Game Shell → Game Runtime: starts (evidence: `README.md`)
- Game Runtime → Island Map: builds (evidence: `src/main.js`)
- Game Runtime → Loot System: populates (evidence: `src/main.js`)
- Game Runtime → Weapons and Effects: initializes (evidence: `src/main.js`)
- Game Runtime → Bot AI: spawns (evidence: `src/main.js`)
- Game Runtime → Player Controller: starts parachute (evidence: `src/main.js`)
- Game Runtime → HUD and Results: updates (evidence: `src/main.js`)
- Game Runtime → HUD and Results: shows results (evidence: `src/main.js`)
- Game Runtime → Sound Engine: starts ambient (evidence: `src/main.js`)
- Loot System → Island Map: reads terrain (evidence: `src/loot.js`)
- Bot AI → Loot System: finds and removes (evidence: `src/bots.js`)
- Player Controller → Safe Zone: checks damage (evidence: `src/player.js`)
- Player Controller → HUD and Results: updates combat HUD (evidence: `src/player.js`)
- Touch Controls → Player Controller: sends controls (evidence: `src/mobile.js`)
- Game Rules → Safe Zone: sets stages (evidence: `src/zone.js`)
- Game Rules → Loot System: sets loot count (evidence: `src/loot.js`)
- Game Rules → Bot AI: sets bot count (evidence: `src/constants.js`)
- Game Rules → Weapons and Effects: sets weapon stats (evidence: `src/constants.js`)
- Player → Game Runtime: starts match (evidence: `src/main.js`)
- Bot AI → Player Controller: fights (evidence: `README.md`)
- Player Controller → Weapons and Effects: fires weapons (evidence: `README.md`)
- Game Runtime → Safe Zone: advances phases (evidence: `README.md`)
- Game Runtime → Touch Controls: enables touch controls (evidence: `README.md`)
