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.
- Host: GitHub
- URL: https://github.com/signalbean/tbs
- Owner: signalbean
- License: wtfpl
- Created: 2025-11-21T05:13:23.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-21T12:50:06.000Z (6 months ago)
- Last Synced: 2025-12-23T03:58:19.437Z (6 months ago)
- Topics: fun, oop, python
- Language: Python
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
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