Skip to content

About

A 2D platformer written in Python using turn-based mechanics to provide interactive learning on AI ethics.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

TuringGame

A platformer with turn based battles about the ethical use of AI. Explore the overworld, walk into an AI-ethics dilemma, and fight it out as a turn based encounter where your choices are the moves.

Built with Python 3.11 + pygame.

CI

TuringGame gameplay

Overworld Battle
Overworld Battle

Quickstart

Requires Python 3.11 and git.

git clone https://github.com/nuclearBulldog/TuringGame.git
cd TuringGame
python3.11 -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python -m turing_game
Installing Python 3.11 on Linux
sudo apt install git python3.11        # Debian/Ubuntu
sudo dnf install git python3.11        # Fedora
sudo pacman -S git python              # Arch

The Windows commands are untested as I do not have a Windows machine. If something is off there please create an issue or PR.

Controls ~ A/D or arrows to move, Space/W/Up to jump, arrows + Enter to pick a battle move, M to mute, Esc to back out.


How it's built

The design goal was to keep game rules, presentation, and content independent of each other, so each can be tested or changed without touching the other two.

TuringGame module architecture

Layout

turing_game/
├── engine/     StateManager, Camera            framework, no game rules
├── states/     MainMenu, Overworld, Battle…    one class per screen
├── systems/    BattleSystem, sprites, audio    rules and asset loading
├── entities/   Player, Enemy                   physics and collision
├── world/      Level, TileMap                  level loading and persistence
├── ui/         BattleUI, ImageButton           drawing only
├── assets/     sprite sheets, font, audio
└── data/       levels (CSV) and encounters (JSON)
tests/          mirrors the package, runs headless
tools/          placeholder-art generator

Development

pip install -r requirements-dev.txt
pytest                                    # 125 tests, headless: no window or audio device
ruff check turing_game tests tools        # lint
pytest --cov=turing_game --cov-report=term-missing

CI runs lint and the full suite on every push and PR, and fails the build if coverage drops below 85%.

The suite runs entirely headless via SDL's dummy drivers, which is why the sheet loader in spritesheet.py falls back to an unconverted surface when no display exists.

Regenerating placeholder art

python tools/gen_placeholder_art.py

Existing sheets are skipped, because several have since been replaced with hand-drawn art. Pass --force only if you mean to overwrite them.


Licence

MIT see LICENSE.txt.

About

A 2D platformer written in Python using turn-based mechanics to provide interactive learning on AI ethics.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages