# lcfyhr/minigames architecture

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

- Interactive diagram: https://gitdiagram.com/lcfyhr/minigames
- Repository: https://github.com/lcfyhr/minigames

## Overview

1. This repository is a collection of **standalone mini-game applications**, not one shared product. Each game lives in its own top-level folder with its own source tree, IDE metadata, and build output. There is **no shared library layer** between the games.

2. The codebase splits cleanly by runtime:
   - **Java projects**: `ChessGame`, `Clingy Wall`, `Jumpy Ball`, `Mario Game`
   - **Python projects**: `snakegame`, `MouseController`
   Each project appears to be independently runnable and packaged.

3. A repeated Java pattern shows a simple desktop-game architecture:
   - a `Main.java` entrypoint starts the game
   - a small set of domain classes model the core objects
   - the main loop likely owns input handling, updates, and rendering
   The file trees suggest these are compact, self-contained game loops rather than layered apps.

4. **Jumpy Ball** is the most minimal Java game structure:
   - `Main.java` orchestrates the game
   - `Ball.java` models the player-controlled object
   - `Wall.java` models obstacles
   The core data flow is likely input → ball movement → wall movement/collision → game state update.

5. **Clingy Wall** follows the same game-loop pattern but with more entities:
   - `Main.java`
   - `Ball.java`
   - `Blocks.java`
   - `Platforms.java`
   This implies a vertical platforming/climbing game where the main loop coordinates physics-like movement, collision with blocks/platforms, and scrolling progression.

6. **Mario Game** is another Java desktop game, but it includes a persistent file:
   - `Main.java`
   - `Highscore.txt`
   The presence of a text file indicates a simple file-based persistence boundary for score tracking, separate from the in-memory game state.

7. **ChessGame** is structured as a board-state model:
   - `Main.java`
   - `Board.java`
   - `Square.java`
   This suggests a local, two-player chess implementation where the board and its squares are explicit state objects, and `Main` drives interaction and turn flow. The README notes unfinished check/checkmate and move validation logic, so the current architecture likely centers on board representation more than complete rules enforcement.

8. The Python side is similarly self-contained. **snakegame** has a single `snake.py`, which likely contains the full game loop, state, and rendering/input logic in one file. That makes it a monolithic script rather than a multi-module app.

9. **MouseController** is not a game but an automation tool:
   - `cprautomine.py`
   - `venv`
   The script is isolated in its own environment, which suggests external library usage and/or OS-level automation. Architecturally, it is a separate utility program with no dependency on the game code.

10. The main architectural boundary across the repo is therefore **per-game isolation**. There is no visible inter-process communication, shared assets, or reusable engine layer. Each folder is its own runtime island with its own entrypoint and state.

11. Input/output is mostly local and interactive:
   - inputs: keyboard/mouse events for the games
   - outputs: game rendering and state changes
   - persistence: only clearly visible in `Mario Game/Highscore.txt`
   - automation: `MouseController` likely interacts with another application via simulated input rather than internal APIs

12. For an architecture diagram, the top-level structure should show:
   - repository root
   - six independent application boxes
   - Java vs. Python runtime separation
   - a small file-persistence side channel for Mario
   - no shared backend, database, or network service

Main entry points: [`Clingy Wall/src/com/company/Main.java`](https://github.com/lcfyhr/minigames/blob/HEAD/Clingy%20Wall/src/com/company/Main.java) (Main), [`ChessGame/src/chess/Main.java`](https://github.com/lcfyhr/minigames/blob/master/ChessGame/src/chess/Main.java) (Main), [`Jumpy Ball/src/com/company/Main.java`](https://github.com/lcfyhr/minigames/blob/HEAD/Jumpy%20Ball/src/com/company/Main.java) (Main), [`ChessGame`](https://github.com/lcfyhr/minigames/tree/master/ChessGame) (ChessGame)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_java["Java apps"]
  node_chessgame["ChessGame<br/>Java game"]
  node_chess_main["Main<br/>entrypoint<br/>[Main.java]"]
  node_chess_board["Board<br/>[Board.java]"]
  node_chess_square["Square<br/>cell model<br/>[Square.java]"]
  node_clingy["Clingy Wall<br/>Java game"]
  node_clingy_main["Main<br/>entrypoint<br/>[Main.java]"]
  node_clingy_ball["Ball<br/>player model<br/>[Ball.java]"]
  node_clingy_blocks["Blocks<br/>obstacle model<br/>[Blocks.java]"]
  node_clingy_platforms["Platforms<br/>level model<br/>[Platforms.java]"]
  node_jumpy["Jumpy Ball<br/>Java game"]
  node_jumpy_main["Main<br/>entrypoint<br/>[Main.java]"]
  node_jumpy_ball["Ball<br/>player model<br/>[Ball.java]"]
  node_jumpy_wall["Wall<br/>obstacle model<br/>[Wall.java]"]
  node_mario["Mario Game<br/>Java game"]
  node_mario_main["Main<br/>entrypoint<br/>[Main.java]"]
  node_mario_score["Highscore<br/>persistence file<br/>[Highscore.txt]"]
end

subgraph group_python["Python apps"]
  node_snake["snakegame<br/>Python game"]
  node_snake_py["snake.py<br/>game script<br/>[snake.py]"]
end

subgraph group_utility["Utility tool"]
  node_mouse["MouseController<br/>Python utility"]
  node_mouse_script["cprautomine.py<br/>automation script<br/>[cprautomine.py]"]
end

node_repo["minigames"]

node_repo -->|"hosts"| node_chessgame
node_repo -->|"hosts"| node_clingy
node_repo -->|"hosts"| node_jumpy
node_repo -->|"hosts"| node_mario
node_repo -->|"hosts"| node_snake
node_repo -->|"hosts"| node_mouse
node_chessgame -->|"entrypoint"| node_chess_main
node_chess_main -->|"uses"| node_chess_board
node_chess_main -->|"uses"| node_chess_square
node_clingy -->|"entrypoint"| node_clingy_main
node_clingy_main -->|"updates"| node_clingy_ball
node_clingy_main -->|"collides"| node_clingy_blocks
node_clingy_main -->|"scrolls"| node_clingy_platforms
node_jumpy -->|"entrypoint"| node_jumpy_main
node_jumpy_main -->|"updates"| node_jumpy_ball
node_jumpy_main -->|"checks"| node_jumpy_wall
node_mario -->|"entrypoint"| node_mario_main
node_mario_main -->|"persists"| node_mario_score
node_snake -->|"contains"| node_snake_py
node_mouse -->|"runs"| node_mouse_script

click node_chessgame "https://github.com/lcfyhr/minigames/tree/master/ChessGame"
click node_chess_main "https://github.com/lcfyhr/minigames/blob/master/ChessGame/src/chess/Main.java"
click node_chess_board "https://github.com/lcfyhr/minigames/blob/master/ChessGame/src/chess/Board.java"
click node_chess_square "https://github.com/lcfyhr/minigames/blob/master/ChessGame/src/chess/Square.java"
click node_clingy "https://github.com/lcfyhr/minigames/tree/master/Clingy Wall"
click node_clingy_main "https://github.com/lcfyhr/minigames/blob/master/Clingy Wall/src/com/company/Main.java"
click node_clingy_ball "https://github.com/lcfyhr/minigames/blob/master/Clingy Wall/src/com/company/Ball.java"
click node_clingy_blocks "https://github.com/lcfyhr/minigames/blob/master/Clingy Wall/src/com/company/Blocks.java"
click node_clingy_platforms "https://github.com/lcfyhr/minigames/blob/master/Clingy Wall/src/com/company/Platforms.java"
click node_jumpy "https://github.com/lcfyhr/minigames/tree/master/Jumpy Ball"
click node_jumpy_main "https://github.com/lcfyhr/minigames/blob/master/Jumpy Ball/src/com/company/Main.java"
click node_jumpy_ball "https://github.com/lcfyhr/minigames/blob/master/Jumpy Ball/src/com/company/Ball.java"
click node_jumpy_wall "https://github.com/lcfyhr/minigames/blob/master/Jumpy Ball/src/com/company/Wall.java"
click node_mario "https://github.com/lcfyhr/minigames/tree/master/Mario Game"
click node_mario_main "https://github.com/lcfyhr/minigames/blob/master/Mario Game/src/com/company/Main.java"
click node_mario_score "https://github.com/lcfyhr/minigames/blob/master/Mario Game/Highscore.txt"
click node_snake "https://github.com/lcfyhr/minigames/tree/master/snakegame"
click node_snake_py "https://github.com/lcfyhr/minigames/blob/master/snakegame/snake.py"
click node_mouse "https://github.com/lcfyhr/minigames/tree/master/MouseController"
click node_mouse_script "https://github.com/lcfyhr/minigames/blob/master/MouseController/cprautomine.py"

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_chessgame,node_chess_main,node_chess_board,node_chess_square,node_clingy,node_clingy_main,node_clingy_ball,node_clingy_blocks,node_clingy_platforms,node_jumpy,node_jumpy_main,node_jumpy_ball,node_jumpy_wall,node_mario,node_mario_main,node_mario_score toneBlue
class node_snake,node_snake_py toneAmber
class node_mouse,node_mouse_script toneMint
class node_repo toneNeutral
```

## Components

### Java apps

Independent desktop games implemented in Java.

- [ChessGame](https://github.com/lcfyhr/minigames/tree/master/ChessGame): Java game · Chess application centered on board state and piece placement. · `ChessGame`
- [Main](https://github.com/lcfyhr/minigames/blob/master/ChessGame/src/chess/Main.java): entrypoint · Starts the chess game and drives interaction flow. · `ChessGame/src/chess/Main.java`
- [Board](https://github.com/lcfyhr/minigames/blob/master/ChessGame/src/chess/Board.java): board model · Represents the chess board and higher-level game state. · `ChessGame/src/chess/Board.java`
- [Square](https://github.com/lcfyhr/minigames/blob/master/ChessGame/src/chess/Square.java): cell model · Represents an individual board square. · `ChessGame/src/chess/Square.java`
- [Clingy Wall](https://github.com/lcfyhr/minigames/tree/HEAD/Clingy%20Wall): Java game · Platforming/climbing game with ball, blocks, and platforms. · `Clingy Wall`
- [Main](https://github.com/lcfyhr/minigames/blob/HEAD/Clingy%20Wall/src/com/company/Main.java): entrypoint · Runs the game loop and coordinates movement and collisions. · `Clingy Wall/src/com/company/Main.java`
- [Ball](https://github.com/lcfyhr/minigames/blob/HEAD/Clingy%20Wall/src/com/company/Ball.java): player model · Models the controllable ball character. · `Clingy Wall/src/com/company/Ball.java`
- [Blocks](https://github.com/lcfyhr/minigames/blob/HEAD/Clingy%20Wall/src/com/company/Blocks.java): obstacle model · Models solid obstacles and collision surfaces. · `Clingy Wall/src/com/company/Blocks.java`
- [Platforms](https://github.com/lcfyhr/minigames/blob/HEAD/Clingy%20Wall/src/com/company/Platforms.java): level model · Models climbing platforms and progression geometry. · `Clingy Wall/src/com/company/Platforms.java`
- [Jumpy Ball](https://github.com/lcfyhr/minigames/tree/HEAD/Jumpy%20Ball): Java game · Minimal arcade game built around a ball and moving walls. · `Jumpy Ball`
- [Main](https://github.com/lcfyhr/minigames/blob/HEAD/Jumpy%20Ball/src/com/company/Main.java): entrypoint · Owns the game loop, input, and state updates. · `Jumpy Ball/src/com/company/Main.java`
- [Ball](https://github.com/lcfyhr/minigames/blob/HEAD/Jumpy%20Ball/src/com/company/Ball.java): player model · Models the player-controlled ball. · `Jumpy Ball/src/com/company/Ball.java`
- [Wall](https://github.com/lcfyhr/minigames/blob/HEAD/Jumpy%20Ball/src/com/company/Wall.java): obstacle model · Models moving or colliding wall obstacles. · `Jumpy Ball/src/com/company/Wall.java`
- [Mario Game](https://github.com/lcfyhr/minigames/tree/HEAD/Mario%20Game): Java game · Desktop game with simple file-based high score persistence. · `Mario Game`
- [Main](https://github.com/lcfyhr/minigames/blob/HEAD/Mario%20Game/src/com/company/Main.java): entrypoint · Runs the game loop and updates score state. · `Mario Game/src/com/company/Main.java`
- [Highscore](https://github.com/lcfyhr/minigames/blob/HEAD/Mario%20Game/Highscore.txt): persistence file · Text file used to store the persistent best score. · `Mario Game/Highscore.txt`

### Python apps

Standalone Python scripts and utilities.

- [snakegame](https://github.com/lcfyhr/minigames/tree/master/snakegame): Python game · Single-file Python snake implementation with monolithic game logic. · `snakegame`
- [snake.py](https://github.com/lcfyhr/minigames/blob/master/snakegame/snake.py): game script · Contains the full snake game loop, state, and I/O. · `snakegame/snake.py`

### Utility tool

Non-game automation program with its own virtual environment.

- [MouseController](https://github.com/lcfyhr/minigames/tree/master/MouseController): Python utility · Automation tool that likely simulates input against another application. · `MouseController`
- [cprautomine.py](https://github.com/lcfyhr/minigames/blob/master/MouseController/cprautomine.py): automation script · Primary script for mouse/input automation. · `MouseController/cprautomine.py`

### Other components

- **minigames**: repository · Collection of isolated mini-game projects and one automation tool.

## Connections

- minigames → ChessGame: hosts · Repository contains an isolated Java game project.
- minigames → Clingy Wall: hosts · Repository contains an isolated Java game project.
- minigames → Jumpy Ball: hosts · Repository contains an isolated Java game project.
- minigames → Mario Game: hosts · Repository contains an isolated Java game project.
- minigames → snakegame: hosts · Repository contains an isolated Python game project.
- minigames → MouseController: hosts · Repository contains a separate Python utility project.
- ChessGame → Main: entrypoint · Main starts the chess application.
- Main → Board: uses · Main drives board state and turn flow.
- Main → Square: uses · Squares form the board's fine-grained state.
- Clingy Wall → Main: entrypoint · Main coordinates the platformer loop.
- Main → Ball: updates · Main advances the player object.
- Main → Blocks: collides · Main checks movement against obstacles.
- Main → Platforms: scrolls · Main advances level geometry and progression.
- Jumpy Ball → Main: entrypoint · Main owns the arcade loop.
- Main → Ball: updates · Main moves the controllable ball.
- Main → Wall: checks · Main handles wall motion and collision.
- Mario Game → Main: entrypoint · Main runs the game and score flow.
- Main → Highscore: persists · High score is stored in a text file.
- snakegame → snake.py: contains · Single-script game implementation.
- MouseController → cprautomine.py: runs · Primary automation logic lives in one script.
