# nrangamadhav/harvest-rush-gameberry-assessment architecture

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

- Interactive diagram: https://gitdiagram.com/nrangamadhav/harvest-rush-gameberry-assessment
- Repository: https://github.com/nrangamadhav/harvest-rush-gameberry-assessment

## Overview

Harvest Rush is a small browser-based farming game. The player moves from the home screen to the lobby, starts a timed round, and collects items while avoiding hay carts. Its runtime is concentrated in game.js, which handles screen transitions, input, game state, and canvas drawing. The README documents the mobile install-style preview and the separate art-asset workflow; the optional Python asset scripts are not part of playing the game. Source excerpts are partial, so unshown runtime connections are omitted.

Main entry points: [`index.html`](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/index.html) (Browser game), [`game.js`](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js) (Screen flow), [`style.css`](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/style.css) (Responsive styling), [`manifest.webmanifest`](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/manifest.webmanifest) (Install preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game_flow["Game flow"]
  node_browser["Browser game<br/>[index.html]"]
  node_screen_flow["Screen flow<br/>[game.js]"]
end

subgraph group_gameplay["Gameplay runtime"]
  node_round_state["Round state<br/>[game.js]"]
  node_controls["Movement controls<br/>[game.js]"]
  node_round_updates["Round updates<br/>[game.js]"]
  node_items_hazards["Items and hazards<br/>[game.js]"]
end

subgraph group_presentation["Presentation"]
  node_canvas_rendering["Canvas rendering<br/>[game.js]"]
  node_responsive_styles["Responsive styling<br/>[style.css]"]
  node_art_assets["Art assets"]
  node_install_preview["Install preview"]
end

node_player(("Player"))

node_player -->|"opens"| node_browser
node_browser -->|"runs"| node_screen_flow
node_screen_flow -->|"starts round"| node_round_state
node_screen_flow -->|"resets round"| node_round_state
node_player -->|"steers"| node_controls
node_controls -->|"sets movement"| node_round_updates
node_round_updates -->|"updates"| node_items_hazards
node_items_hazards -->|"changes score"| node_round_state
node_round_updates -->|"renders round"| node_canvas_rendering
node_browser -->|"uses styling"| node_responsive_styles
node_player -->|"adds to home screen"| node_install_preview

click node_browser "https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/index.html"
click node_screen_flow "https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js"
click node_round_state "https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js"
click node_controls "https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js"
click node_round_updates "https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js"
click node_items_hazards "https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js"
click node_canvas_rendering "https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js"
click node_responsive_styles "https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/style.css"
click node_art_assets "https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/tree/main/assets"
click node_install_preview "https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/manifest.webmanifest"

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_browser,node_screen_flow toneBlue
class node_round_state,node_controls,node_round_updates,node_items_hazards toneAmber
class node_canvas_rendering,node_responsive_styles,node_art_assets,node_install_preview toneMint
class node_player toneIndigo
```

## Components

### Game flow

- [Browser game](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/index.html): `index.html`
- [Screen flow](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js): `game.js`

### Gameplay runtime

- [Round state](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js): `game.js`
- [Movement controls](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js): `game.js`
- [Round updates](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js): `game.js`
- [Items and hazards](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js): `game.js`

### Presentation

- [Canvas rendering](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/game.js): `game.js`
- [Responsive styling](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/style.css): `style.css`
- [Art assets](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/tree/main/assets): `assets`
- [Install preview](https://github.com/nrangamadhav/harvest-rush-gameberry-assessment/blob/main/manifest.webmanifest): `manifest.webmanifest`

### Other components

- **Player**

## Connections

- Player → Browser game: opens (evidence: `README.md`)
- Browser game → Screen flow: runs (evidence: `README.md`)
- Screen flow → Round state: starts round (evidence: `game.js`)
- Screen flow → Round state: resets round (evidence: `game.js`)
- Player → Movement controls: steers (evidence: `README.md`)
- Movement controls → Round updates: sets movement (evidence: `game.js`)
- Round updates → Items and hazards: updates (evidence: `game.js`)
- Items and hazards → Round state: changes score (evidence: `game.js`)
- Round updates → Canvas rendering: renders round (evidence: `game.js`)
- Browser game → Responsive styling: uses styling (evidence: `README.md`)
- Player → Install preview: adds to home screen (evidence: `README.md`)
