# seiya0106/maze architecture

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

- Interactive diagram: https://gitdiagram.com/seiya0106/maze
- Repository: https://github.com/seiya0106/maze

## Overview

This repository contains a small Siv3D maze game. During each frame, the game draws the generated maze, processes arrow-key movement while the player is exploring, and detects arrival at the goal; after clearing, Space resets the maze and player for another run. The Stage implementation owns maze generation, drawing, and movement checks, while Player owns position, input handling, and its sprite. The README documents the user-facing controls; the graph is limited to the sampled game source and documented behavior.

Main entry points: [`projects/Game/src/Main.cpp`](https://github.com/seiya0106/maze/blob/main/projects/Game/src/Main.cpp) (Frame loop), [`projects/Game/src/Stage.cpp`](https://github.com/seiya0106/maze/blob/main/projects/Game/src/Stage.cpp) (Maze stage), [`projects/Game/src/Player.cpp`](https://github.com/seiya0106/maze/blob/main/projects/Game/src/Player.cpp) (Player state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flow["Game flow"]
  node_main["Frame loop<br/>[Main.cpp]"]
end

subgraph group_play["Maze gameplay"]
  node_maze["Maze stage<br/>[Stage.cpp]"]
  node_player["Player state<br/>[Player.cpp]"]
end

subgraph group_view["Game display"]
  node_maze_view["Maze drawing<br/>[Stage.cpp]"]
  node_player_view["Sprite drawing<br/>[Player.cpp]"]
end

node_user(("Player"))

node_user -->|"controls"| node_main
node_main -->|"draws maze"| node_maze_view
node_main -->|"updates"| node_player
node_player -->|"checks movement"| node_maze
node_main -->|"checks goal"| node_maze
node_main -->|"resets maze"| node_maze
node_main -->|"resets position"| node_player
node_main -->|"draws sprite"| node_player_view
node_main -->|"gets cell center"| node_maze

click node_main "https://github.com/seiya0106/maze/blob/main/projects/Game/src/Main.cpp"
click node_maze "https://github.com/seiya0106/maze/blob/main/projects/Game/src/Stage.cpp"
click node_player "https://github.com/seiya0106/maze/blob/main/projects/Game/src/Player.cpp"
click node_maze_view "https://github.com/seiya0106/maze/blob/main/projects/Game/src/Stage.cpp"
click node_player_view "https://github.com/seiya0106/maze/blob/main/projects/Game/src/Player.cpp"

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_main toneBlue
class node_maze,node_player toneAmber
class node_maze_view,node_player_view toneMint
class node_user toneIndigo
```

## Components

### Game flow

- [Frame loop](https://github.com/seiya0106/maze/blob/main/projects/Game/src/Main.cpp): `projects/Game/src/Main.cpp`

### Maze gameplay

- [Maze stage](https://github.com/seiya0106/maze/blob/main/projects/Game/src/Stage.cpp): `projects/Game/src/Stage.cpp`
- [Player state](https://github.com/seiya0106/maze/blob/main/projects/Game/src/Player.cpp): `projects/Game/src/Player.cpp`

### Game display

- [Maze drawing](https://github.com/seiya0106/maze/blob/main/projects/Game/src/Stage.cpp): `projects/Game/src/Stage.cpp`
- [Sprite drawing](https://github.com/seiya0106/maze/blob/main/projects/Game/src/Player.cpp): `projects/Game/src/Player.cpp`

### Other components

- **Player**

## Connections

- Player → Frame loop: controls (evidence: `README.md`)
- Frame loop → Maze drawing: draws maze (evidence: `projects/Game/src/Main.cpp`)
- Frame loop → Player state: updates (evidence: `projects/Game/src/Main.cpp`)
- Player state → Maze stage: checks movement (evidence: `projects/Game/src/Player.cpp`)
- Frame loop → Maze stage: checks goal (evidence: `projects/Game/src/Main.cpp`)
- Frame loop → Maze stage: resets maze (evidence: `projects/Game/src/Main.cpp`)
- Frame loop → Player state: resets position (evidence: `projects/Game/src/Main.cpp`)
- Frame loop → Sprite drawing: draws sprite (evidence: `projects/Game/src/Main.cpp`)
- Frame loop → Maze stage: gets cell center (evidence: `projects/Game/src/Main.cpp`)
