# 1x1-studio/pyxil architecture

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

- Interactive diagram: https://gitdiagram.com/1x1-studio/pyxil
- Repository: https://github.com/1x1-studio/pyxil

## Overview

Pyxil is a small Python framework for desktop-game development. Its visible entry point is the Game base class: constructing it creates a console, time object, and sprite batch, then calls the initialization hook. The excerpts do not show a running game loop or calls to update/draw, and GameWindow is imported but not selected by the shown implementation. The graph therefore shows only those constructor relationships; the broader desktop-game workflow is not established by the available source.

Main entry points: [`pyxil/framework/game.py`](https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/game.py) (Game base), [`pyxil/framework/gameconsole.py`](https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/gameconsole.py) (Game console), [`pyxil/framework/gametime.py`](https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/gametime.py) (Game time), [`pyxil/framework/graphics/spritebatch.py`](https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/graphics/spritebatch.py) (Sprite batch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lifecycle["Game lifecycle"]
  node_game["Game base<br/>[game.py]"]
  node_initialize["Initialize hook<br/>[game.py]"]
end

subgraph group_runtime["Runtime components"]
  node_console["Game console<br/>[gameconsole.py]"]
  node_gametime["Game time<br/>[gametime.py]"]
  node_spritebatch["Sprite batch<br/>[spritebatch.py]"]
  node_gamewindow["Game window<br/>[gamewindow.py]"]
end

node_developer(("Game developer"))

node_developer -.->|"subclasses"| node_game
node_game -->|"creates"| node_console
node_game -->|"creates"| node_gametime
node_game -->|"creates"| node_spritebatch
node_game -->|"calls"| node_initialize

click node_game "https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/game.py"
click node_initialize "https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/game.py"
click node_console "https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/gameconsole.py"
click node_gametime "https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/gametime.py"
click node_spritebatch "https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/graphics/spritebatch.py"
click node_gamewindow "https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/gamewindow.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_game,node_initialize toneBlue
class node_console,node_gametime,node_spritebatch,node_gamewindow toneAmber
class node_developer toneIndigo
```

## Components

### Game lifecycle

- [Game base](https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/game.py): `pyxil/framework/game.py`
- [Initialize hook](https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/game.py): `pyxil/framework/game.py`

### Runtime components

- [Game console](https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/gameconsole.py): `pyxil/framework/gameconsole.py`
- [Game time](https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/gametime.py): `pyxil/framework/gametime.py`
- [Sprite batch](https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/graphics/spritebatch.py): `pyxil/framework/graphics/spritebatch.py`
- [Game window](https://github.com/1x1-studio/pyxil/blob/main/pyxil/framework/gamewindow.py): `pyxil/framework/gamewindow.py`

### Other components

- **Game developer**

## Connections

- Game developer → Game base: subclasses
- Game base → Game console: creates (evidence: `pyxil/framework/game.py`)
- Game base → Game time: creates (evidence: `pyxil/framework/game.py`)
- Game base → Sprite batch: creates (evidence: `pyxil/framework/game.py`)
- Game base → Initialize hook: calls (evidence: `pyxil/framework/game.py`)
