# sully-vian/newtonoid architecture

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

- Interactive diagram: https://gitdiagram.com/sully-vian/newtonoid
- Repository: https://github.com/sully-vian/newtonoid

## Overview

Newtonoid is an OCaml game, described as a program whose implementation is split between a main executable in `bin/` and a reusable game library in `lib/`. The tree identifies gameplay, level, parameter, and state modules, plus level and configuration files. The README documents that executable modules can use the library; source excerpts were unavailable, so specific runtime calls, data loading, and gameplay sequencing cannot be confirmed.

Main entry points: [`bin/newtonoid.ml`](https://github.com/sully-vian/newtonoid/blob/master/bin/newtonoid.ml) (Game executable), [`lib`](https://github.com/sully-vian/newtonoid/tree/master/lib) (Game library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_entry["Game executable<br/>[newtonoid.ml]"]
  node_library["Game library"]
end

subgraph group_gameplay["Gameplay"]
  node_game["Game logic<br/>[game.ml]"]
  node_state["Game state<br/>[state.ml]"]
  node_input["Input<br/>[input.ml]"]
  node_paddle["Paddle<br/>[paddle.ml]"]
  node_ball["Ball<br/>[ball.ml]"]
  node_brick["Brick<br/>[brick.ml]"]
  node_box["Box<br/>[box.ml]"]
end

subgraph group_levels["Levels and settings"]
  node_level["Level<br/>[level.ml]"]
  node_loader["Level loader<br/>[loadLevel.ml]"]
  node_params["Parameters<br/>[params.ml]"]
  node_validator["Parameter validation<br/>[paramValidator.ml]"]
  node_leveldata["Level files"]
  node_configdata["Configuration files"]
end

subgraph group_simulation["Simulation"]
  node_collision["Collision<br/>[collision.ml]"]
  node_quadtree["Spatial tree<br/>[quadtree.ml]"]
  node_iterator["Iterator<br/>[iterator.ml]"]
end

node_player(("Player"))

node_entry -->|"uses"| node_library

click node_entry "https://github.com/sully-vian/newtonoid/blob/master/bin/newtonoid.ml"
click node_library "https://github.com/sully-vian/newtonoid/tree/master/lib"
click node_game "https://github.com/sully-vian/newtonoid/blob/master/lib/game.ml"
click node_state "https://github.com/sully-vian/newtonoid/blob/master/lib/state.ml"
click node_input "https://github.com/sully-vian/newtonoid/blob/master/lib/input.ml"
click node_paddle "https://github.com/sully-vian/newtonoid/blob/master/lib/paddle.ml"
click node_ball "https://github.com/sully-vian/newtonoid/blob/master/lib/ball.ml"
click node_brick "https://github.com/sully-vian/newtonoid/blob/master/lib/brick.ml"
click node_box "https://github.com/sully-vian/newtonoid/blob/master/lib/box.ml"
click node_collision "https://github.com/sully-vian/newtonoid/blob/master/lib/collision.ml"
click node_quadtree "https://github.com/sully-vian/newtonoid/blob/master/lib/quadtree.ml"
click node_iterator "https://github.com/sully-vian/newtonoid/blob/master/lib/iterator.ml"
click node_level "https://github.com/sully-vian/newtonoid/blob/master/lib/level.ml"
click node_loader "https://github.com/sully-vian/newtonoid/blob/master/lib/loadLevel.ml"
click node_params "https://github.com/sully-vian/newtonoid/blob/master/lib/params.ml"
click node_validator "https://github.com/sully-vian/newtonoid/blob/master/lib/paramValidator.ml"
click node_leveldata "https://github.com/sully-vian/newtonoid/tree/master/levels"
click node_configdata "https://github.com/sully-vian/newtonoid/tree/master/configs"

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_entry,node_library toneBlue
class node_game,node_state,node_input,node_paddle,node_ball,node_brick,node_box toneAmber
class node_level,node_loader,node_params,node_validator,node_leveldata,node_configdata toneMint
class node_collision,node_quadtree,node_iterator toneRose
class node_player toneIndigo
```

## Components

### Runtime

- [Game executable](https://github.com/sully-vian/newtonoid/blob/master/bin/newtonoid.ml): `bin/newtonoid.ml`
- [Game library](https://github.com/sully-vian/newtonoid/tree/master/lib): `lib`

### Gameplay

- [Game logic](https://github.com/sully-vian/newtonoid/blob/master/lib/game.ml): `lib/game.ml`
- [Game state](https://github.com/sully-vian/newtonoid/blob/master/lib/state.ml): `lib/state.ml`
- [Input](https://github.com/sully-vian/newtonoid/blob/master/lib/input.ml): `lib/input.ml`
- [Paddle](https://github.com/sully-vian/newtonoid/blob/master/lib/paddle.ml): `lib/paddle.ml`
- [Ball](https://github.com/sully-vian/newtonoid/blob/master/lib/ball.ml): `lib/ball.ml`
- [Brick](https://github.com/sully-vian/newtonoid/blob/master/lib/brick.ml): `lib/brick.ml`
- [Box](https://github.com/sully-vian/newtonoid/blob/master/lib/box.ml): `lib/box.ml`

### Levels and settings

- [Level](https://github.com/sully-vian/newtonoid/blob/master/lib/level.ml): `lib/level.ml`
- [Level loader](https://github.com/sully-vian/newtonoid/blob/master/lib/loadLevel.ml): `lib/loadLevel.ml`
- [Parameters](https://github.com/sully-vian/newtonoid/blob/master/lib/params.ml): `lib/params.ml`
- [Parameter validation](https://github.com/sully-vian/newtonoid/blob/master/lib/paramValidator.ml): `lib/paramValidator.ml`
- [Level files](https://github.com/sully-vian/newtonoid/tree/master/levels): `levels`
- [Configuration files](https://github.com/sully-vian/newtonoid/tree/master/configs): `configs`

### Simulation

- [Collision](https://github.com/sully-vian/newtonoid/blob/master/lib/collision.ml): `lib/collision.ml`
- [Spatial tree](https://github.com/sully-vian/newtonoid/blob/master/lib/quadtree.ml): `lib/quadtree.ml`
- [Iterator](https://github.com/sully-vian/newtonoid/blob/master/lib/iterator.ml): `lib/iterator.ml`

### Other components

- **Player**

## Connections

- Game executable → Game library: uses
