Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Tactical Terminal Combat Simulator

A state-driven, turn-based combat game built entirely in Python — no libraries, no dependencies.

Python Platform Dependencies Status

About

Tactical Terminal Combat Simulator is a 1v1 turn-based battle game that runs directly in your terminal. It was built as a hands-on exercise in core software engineering patterns — specifically around state management, modular logic routing, and rule-based AI decision-making.

No game engines. No third-party libraries. Just Python.


Tech Stack

Layer Technology
Language Python 3.x
Dependencies None (standard library only)
Interface Terminal / CLI

Architecture

The codebase is structured around scalable design patterns rather than brittle nested conditionals:

  • State Management — Entity stats (HP, Stamina, Armor, Potions, Defense) are stored in Python dictionaries, enabling clean and predictable state mutations across the game loop.
  • DRY Logic Routing — All combat math (RNG hit checks, armor reduction, status resets) is centralized in a single execute_action() function, eliminating code duplication across attack types.
  • Conditional AI — The enemy evaluates its own resource thresholds each turn (HP and stamina) to decide whether to attack, defend, or heal — no hardcoded sequences.
  • Config-Driven Difficulty — Difficulty levels are defined in a configuration dictionary with .get() fallbacks, avoiding cascading if/else chains and protecting against invalid input.

Gameplay

A resource management duel — knowing when to attack matters as much as how hard you hit.

Available Actions

# Action Description
1 Light Attack 90% hit chance · Low damage · Recovers 5 stamina
2 Heavy Attack 50% hit chance · High damage · Costs 15 stamina
3 Defend & Rest Skips attack · Recovers 20 stamina · Halves next incoming hit
4 Heal Consumes a potion · Restores 30 HP · Capped at max health

Getting Started

Requirement: Python 3.x — nothing else needed.

# 1. Clone the repository
git clone https://github.com/your-username/your-repo-name.git

# 2. Navigate into the project directory
cd your-repo-name

# 3. Run the game
python game.py

Roadmap

  • OOP Refactor — Migrate dictionary-based state into Python classes (Character, Player, Enemy)
  • UI Decoupling — Separate terminal output from the core logic engine to prep for a potential web frontend

About

A Python CLI game that manages turn-based state logic and simulates tactical combat directly in the terminal.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages