# vixwoke/ise_assignment architecture

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

- Interactive diagram: https://gitdiagram.com/vixwoke/ise_assignment
- Repository: https://github.com/vixwoke/ise_assignment

## Overview

1. **Overall shape**
   - This is a **Python 2D game project** organized around a single executable entry point and a set of scene/entity modules.
   - The architecture is split between **game flow/state management** and **domain objects** like player, enemies, bullets, and partner.

2. **Entry point and orchestration**
   - `main.py` is the likely startup file.
   - `game.py` appears to be the central orchestrator: it likely owns the main loop, current game state, transitions between scenes, and shared runtime services.

3. **Scene/state boundaries**
   - The repository is structured as a sequence of game states rather than a generic application:
     - `menu.py` for the start/menu screen
     - `intro_cutscene.py` for intro narrative presentation
     - `dialogue.py` for story conversation UI/logic
     - `end_screen.py` for game over / ending display
   - These modules likely plug into `game.py` as switchable screens or phases.

4. **Core gameplay entities**
   - `player.py`, `enemy.py`, `partner.py`, and `bullets.py` represent the main in-game actors and projectiles.
   - These are the primary simulation objects updated during active gameplay.
   - `partner.py` suggests a companion/AI ally that participates in combat or scripted events.

5. **Combat and interaction flow**
   - `bullets.py` and `enemy.py` indicate a combat loop centered on shooting and melee/impact effects.
   - The presence of audio assets like `gun.wav`, `shotgun.wav`, `melee_hit.wav`, `reload.wav`, and `howl.wav` suggests that combat feedback is tied directly to entity actions.
   - This likely flows from player input into entity state changes, then to collision/damage handling and sound playback.

6. **Animation and sprite management**
   - `sprites.py` is likely a shared layer for loading, slicing, or animating sprite assets.
   - The `resources/image/sprites/` subtree contains character-specific asset sets:
     - `maincharacter`
     - `partner`
     - `enemy`
     - wounded/rage variants
   - This implies entity modules depend on a common sprite/animation utility rather than each loading assets independently.

7. **Narrative scripting**
   - `timeline.py`, `dialogue.py`, and `intro_cutscene.py` form a story-control subsystem.
   - `timeline.py` likely defines scripted beats, triggers, or timed events that coordinate camera/dialogue/gameplay transitions.
   - This subsystem is separate from combat logic, which is useful for diagramming a clear boundary between **scripted presentation** and **real-time gameplay**.

8. **Configuration and shared constants**
   - `config.py` likely stores screen dimensions, frame timing, gameplay constants, asset paths, colors, or tuning values.
   - It is probably imported across most modules to keep the game state and rendering consistent.

9. **Assets and external dependencies**
   - The `resources/` directory is the main asset boundary:
     - `audio/` for effects and music
     - `fonts/`
     - `image/` for backgrounds, UI elements, and sprites
   - The `.wav`/`.mp3` assets and sprite archives indicate the project is built as a local desktop game with bundled media, not a networked service.

10. **Likely runtime/data flow**
   - Startup: `main.py` initializes configuration and launches `game.py`.
   - Flow: menu → intro cutscene/dialogue → gameplay → end screen.
   - During gameplay: input updates `player`, `partner`, `enemy`, and `bullets`; rendering uses `sprites.py` and assets from `resources/`; events and narrative pacing are coordinated by `timeline.py` and `dialogue.py`.

11. **Diagram boundaries to emphasize**
   - One boundary around **application flow/state management**: `main.py`, `game.py`, scene modules.
   - One boundary around **gameplay simulation**: player/enemy/partner/bullets.
   - One boundary around **presentation and content**: sprites, audio, fonts, images, cutscenes, dialogue.
   - `config.py` sits as a shared dependency across these layers.

12. **What this repo is not**
   - It does not look like a client-server app, database app, or microservice.
   - The important architecture is **single-process, asset-driven, state-based game logic** with scripted narrative and combat scenes.

Main entry points: [`game.py`](https://github.com/vixwoke/ise_assignment/blob/master/game.py) (game.py), [`sprites.py`](https://github.com/vixwoke/ise_assignment/blob/master/sprites.py) (Sprites), [`config.py`](https://github.com/vixwoke/ise_assignment/blob/master/config.py) (Config), [`resources`](https://github.com/vixwoke/ise_assignment/tree/master/resources) (Resources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flow["Game Flow"]
  node_main_py["main.py<br/>entrypoint<br/>[main.py]"]
  node_game_py["game.py<br/>orchestrator<br/>[game.py]"]
  node_menu_py["Menu<br/>scene<br/>[menu.py]"]
  node_intro_py["Intro<br/>scene<br/>[intro_cutscene.py]"]
  node_dialogue_py["Dialogue<br/>scene<br/>[dialogue.py]"]
  node_timeline_py["Timeline<br/>scripted events<br/>[timeline.py]"]
  node_end_py["End Screen<br/>scene<br/>[end_screen.py]"]
end

subgraph group_play["Gameplay"]
  node_player_py(("Player<br/>actor<br/>[player.py]"))
  node_partner_py(("Partner<br/>ally actor<br/>[partner.py]"))
  node_enemy_py(("Enemy<br/>opponent<br/>[enemy.py]"))
  node_bullets_py(("Bullets<br/>projectiles<br/>[bullets.py]"))
end

subgraph group_content["Content"]
  node_sprites_py["Sprites<br/>asset loader<br/>[sprites.py]"]
  node_config_py["Config<br/>settings<br/>[config.py]"]
  node_resources[("Resources<br/>assets")]
end

node_main_py -->|"starts"| node_game_py
node_game_py -->|"opens"| node_menu_py
node_game_py -->|"switches"| node_intro_py
node_game_py -->|"switches"| node_dialogue_py
node_game_py -->|"drives"| node_timeline_py
node_game_py -->|"switches"| node_end_py
node_game_py -->|"updates"| node_player_py
node_game_py -->|"updates"| node_partner_py
node_game_py -->|"updates"| node_enemy_py
node_game_py -->|"updates"| node_bullets_py
node_player_py -->|"uses"| node_sprites_py
node_partner_py -->|"uses"| node_sprites_py
node_enemy_py -->|"uses"| node_sprites_py
node_bullets_py -->|"uses"| node_sprites_py
node_menu_py -->|"loads"| node_resources
node_intro_py -->|"loads"| node_resources
node_dialogue_py -->|"loads"| node_resources
node_sprites_py -->|"loads"| node_resources
node_player_py -->|"reads"| node_config_py
node_enemy_py -->|"reads"| node_config_py
node_game_py -->|"reads"| node_config_py
node_timeline_py -->|"reads"| node_config_py

click node_main_py "https://github.com/vixwoke/ise_assignment/blob/master/main.py"
click node_game_py "https://github.com/vixwoke/ise_assignment/blob/master/game.py"
click node_menu_py "https://github.com/vixwoke/ise_assignment/blob/master/menu.py"
click node_intro_py "https://github.com/vixwoke/ise_assignment/blob/master/intro_cutscene.py"
click node_dialogue_py "https://github.com/vixwoke/ise_assignment/blob/master/dialogue.py"
click node_timeline_py "https://github.com/vixwoke/ise_assignment/blob/master/timeline.py"
click node_end_py "https://github.com/vixwoke/ise_assignment/blob/master/end_screen.py"
click node_player_py "https://github.com/vixwoke/ise_assignment/blob/master/player.py"
click node_partner_py "https://github.com/vixwoke/ise_assignment/blob/master/partner.py"
click node_enemy_py "https://github.com/vixwoke/ise_assignment/blob/master/enemy.py"
click node_bullets_py "https://github.com/vixwoke/ise_assignment/blob/master/bullets.py"
click node_sprites_py "https://github.com/vixwoke/ise_assignment/blob/master/sprites.py"
click node_config_py "https://github.com/vixwoke/ise_assignment/blob/master/config.py"
click node_resources "https://github.com/vixwoke/ise_assignment/tree/master/resources"

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_py,node_game_py,node_menu_py,node_intro_py,node_dialogue_py,node_timeline_py,node_end_py toneBlue
class node_player_py,node_partner_py,node_enemy_py,node_bullets_py toneAmber
class node_sprites_py,node_config_py,node_resources toneMint
```

## Components

### Game Flow

Startup, state switching, and scripted scenes.

- [main.py](https://github.com/vixwoke/ise_assignment/blob/master/main.py): entrypoint · Launches the game application. · `main.py`
- [game.py](https://github.com/vixwoke/ise_assignment/blob/master/game.py): orchestrator · Owns the main loop and scene transitions. · `game.py`
- [Menu](https://github.com/vixwoke/ise_assignment/blob/master/menu.py): scene · Start screen and menu interaction. · `menu.py`
- [Intro](https://github.com/vixwoke/ise_assignment/blob/master/intro_cutscene.py): scene · Opening cutscene and narrative setup. · `intro_cutscene.py`
- [Dialogue](https://github.com/vixwoke/ise_assignment/blob/master/dialogue.py): scene · Story conversation and text presentation. · `dialogue.py`
- [Timeline](https://github.com/vixwoke/ise_assignment/blob/master/timeline.py): scripted events · Coordinates timed beats and narrative flow. · `timeline.py`
- [End Screen](https://github.com/vixwoke/ise_assignment/blob/master/end_screen.py): scene · Game over or ending display. · `end_screen.py`

### Gameplay

Real-time simulation and combat actors.

- [Player](https://github.com/vixwoke/ise_assignment/blob/master/player.py): actor · Main controllable character. · `player.py`
- [Partner](https://github.com/vixwoke/ise_assignment/blob/master/partner.py): ally actor · Companion or support character. · `partner.py`
- [Enemy](https://github.com/vixwoke/ise_assignment/blob/master/enemy.py): opponent · Hostile combatant and AI target. · `enemy.py`
- [Bullets](https://github.com/vixwoke/ise_assignment/blob/master/bullets.py): projectiles · Shot and impact entities for combat. · `bullets.py`

### Content

Shared configuration and bundled assets.

- [Sprites](https://github.com/vixwoke/ise_assignment/blob/master/sprites.py): asset loader · Shared sprite loading and animation support. · `sprites.py`
- [Config](https://github.com/vixwoke/ise_assignment/blob/master/config.py): settings · Shared constants and runtime configuration. · `config.py`
- [Resources](https://github.com/vixwoke/ise_assignment/tree/master/resources): assets · Bundled audio, images, fonts, and sprite archives. · `resources`

## Connections

- main.py → game.py: starts · Entry point initializes the game runtime.
- game.py → Menu: opens · Main loop enters the menu state.
- game.py → Intro: switches · Transitions into the intro cutscene.
- game.py → Dialogue: switches · Routes story conversation scenes.
- game.py → Timeline: drives · Uses scripted events to pace scenes.
- game.py → End Screen: switches · Shows the ending or failure screen.
- game.py → Player: updates · Coordinates active gameplay entities.
- game.py → Partner: updates · Coordinates ally behavior during play.
- game.py → Enemy: updates · Coordinates enemy simulation and AI.
- game.py → Bullets: updates · Manages projectiles and combat effects.
- Player → Sprites: uses · Player animation and sprite handling.
- Partner → Sprites: uses · Partner animation and sprite handling.
- Enemy → Sprites: uses · Enemy animation and sprite handling.
- Bullets → Sprites: uses · Projectile visuals use shared sprite support.
- Menu → Resources: loads · Menu art and sound assets.
- Intro → Resources: loads · Cutscene images, text, and audio.
- Dialogue → Resources: loads · Dialogue presentation assets.
- Sprites → Resources: loads · Reads sprite sheets and image sets.
- Player → Config: reads · Uses shared tuning and runtime constants.
- Enemy → Config: reads · Uses shared tuning and runtime constants.
- game.py → Config: reads · Uses shared window and loop settings.
- Timeline → Config: reads · Uses shared timing and scene constants.
