# lilwad-0730/bro_we_are_cooked architecture

> Architecture diagram of the GitHub repository lilwad-0730/bro_we_are_cooked, 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/lilwad-0730/bro_we_are_cooked
- Repository: https://github.com/lilwad-0730/bro_we_are_cooked

## Overview

This is a browser-based, two-team cooking competition with gathering, kitchen production, order delivery, and combat over ingredients and cooking stations. The player acts through keyboard or touch controls; the main loop advances player control, NPC planning, world simulation, and (during the tutorial) tutorial progression. Separate rule responsibilities cover cooking and scoring versus combat and station sabotage. The excerpts show only selected calls, so the graph omits unverified wiring among rendering, art, configuration, and other modules rather than inferring it.

Main entry points: [`js/main.js`](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/main.js) (Game Loop), [`js/rules.js`](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/rules.js) (Cooking and Orders), [`js/ai.js`](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/ai.js) (NPC Planner), [`js/config.js`](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/config.js) (Game Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Play and Simulation"]
  node_controls["Player Controls<br/>[main.js]"]
  node_game_loop["Game Loop<br/>[main.js]"]
  node_npc_ai["NPC Planner<br/>[ai.js]"]
  node_world_sim["World Simulation<br/>[rules.js]"]
end

subgraph group_domain["Game Rules"]
  node_production["Cooking and Orders<br/>[rules.js]"]
  node_combat["Combat and Sabotage<br/>[rules.js]"]
  node_config["Game Configuration<br/>[config.js]"]
end

subgraph group_environment["World and Presentation"]
  node_map["Map and Visibility<br/>[world.js]"]
  node_renderer["Game Renderer<br/>[render.js]"]
  node_art["Vector Game Art<br/>[art.js]"]
end

subgraph group_guidance["Tutorial"]
  node_tutorial["Tutorial Progression<br/>[tutorial.js]"]
end

node_player(("Player"))

node_player -->|"controls"| node_controls
node_controls -->|"starts actions"| node_production
node_game_loop -->|"updates"| node_controls
node_game_loop -->|"updates"| node_npc_ai
node_game_loop -->|"updates"| node_world_sim
node_game_loop -->|"updates"| node_tutorial
node_npc_ai -->|"starts actions"| node_production
node_production -->|"advances simulation"| node_world_sim
node_controls -->|"reads settings"| node_config
node_production -->|"reads settings"| node_config

click node_controls "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/main.js"
click node_game_loop "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/main.js"
click node_npc_ai "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/ai.js"
click node_world_sim "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/rules.js"
click node_production "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/rules.js"
click node_combat "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/rules.js"
click node_config "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/config.js"
click node_map "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/world.js"
click node_renderer "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/render.js"
click node_art "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/art.js"
click node_tutorial "https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/tutorial.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_game_loop,node_npc_ai,node_world_sim toneBlue
class node_production,node_combat,node_config toneAmber
class node_map,node_renderer,node_art toneMint
class node_tutorial toneRose
class node_player toneIndigo
```

## Components

### Play and Simulation

- [Player Controls](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/main.js): `js/main.js`
- [Game Loop](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/main.js): `js/main.js`
- [NPC Planner](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/ai.js): `js/ai.js`
- [World Simulation](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/rules.js): `js/rules.js`

### Game Rules

- [Cooking and Orders](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/rules.js): `js/rules.js`
- [Combat and Sabotage](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/rules.js): `js/rules.js`
- [Game Configuration](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/config.js): `js/config.js`

### World and Presentation

- [Map and Visibility](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/world.js): `js/world.js`
- [Game Renderer](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/render.js): `js/render.js`
- [Vector Game Art](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/art.js): `js/art.js`

### Tutorial

- [Tutorial Progression](https://github.com/lilwad-0730/bro_we_are_cooked/blob/main/js/tutorial.js): `js/tutorial.js`

### Other components

- **Player**

## Connections

- Player → Player Controls: controls (evidence: `js/main.js`)
- Player Controls → Cooking and Orders: starts actions (evidence: `js/main.js`)
- Game Loop → Player Controls: updates (evidence: `js/main.js`)
- Game Loop → NPC Planner: updates (evidence: `js/main.js`)
- Game Loop → World Simulation: updates (evidence: `js/main.js`)
- Game Loop → Tutorial Progression: updates (evidence: `js/main.js`)
- NPC Planner → Cooking and Orders: starts actions (evidence: `js/ai.js`)
- Cooking and Orders → World Simulation: advances simulation (evidence: `js/rules.js`)
- Player Controls → Game Configuration: reads settings (evidence: `js/main.js`)
- Cooking and Orders → Game Configuration: reads settings (evidence: `js/rules.js`)
