An open API service indexing awesome lists of open source software.

https://github.com/signalbean/tbs

Text-based Python combat demo with simple OOP and colored health bars.
https://github.com/signalbean/tbs

fun oop python

Last synced: about 2 months ago
JSON representation

Text-based Python combat demo with simple OOP and colored health bars.

Awesome Lists containing this project

README

          

# Terminal Battle Sim

A small Python OOP demo where two characters fight each other in the terminal. Characters, weapons, and a colored health bar each use their own class. The health bar uses ANSI colors and fills with specific symbols as HP moves. Weapons define damage, the hero can change them, and `main.py` runs a loop that clears the screen, shows the bars, applies attacks, and waits for Enter along with weapon switching for the Hero character.

## Files

* `main.py`: runs the battle loop
* `character.py`: character logic plus `Hero` and `Enemy`
* `weapon.py`: weapon classes and presets
* `healthbar.py`: draws colored health bars

## Run

```bash
python main.py
```

Press Enter for each round. `Ctrl+C` to quit.

## License

WTFPL