Terminal Game Maker
Project description
Workflow Status
Python
C++
pyTGM (Python Terminal Game Maker)
pyTGM is a simplified alternative to Pygame, focusing on ASCII and ANSI based game development, contained completley within the terminal,
with utilities for encryption, markup, mouse input, and much more.
To download pyTGM using pip, run pip install pyTGM
YOU MUST TYPE PYTGM EXACTLY AS IT IS SAID
It is NOT recommended that you download earlier than 4.1.0; Earlier than this, importing was untested!
Amongst other things, all previous versions were built for windows only.
4.1.0 fixes this.
It is MOST reccomended, that you download the latest version!
Bugs and Features
To report a bug, go here
For feature request, go here
Contributing
All contributions are greatly appreciated.
To make a contribution, make a new branch here
Then, add (or remove), to improve the repo!
Once we know it's working and safe, somebody will merge the request!
Features
File Operations
file.mod_line(name) # Modify a line of a file
file.read_line(name, line=0) # Read specific line
Graphics and Text Styling
# Clear screen
graphics.cls()
# Color text (RGB)
graphics.color(0, 255, 0) # Green text
graphics.RESET # Reset color
# Markup
graphics.BOLD
graphics.ITALIC
graphics.UNDERLINE
# Placing the cursor at a pair of coordinates
graphics.pos()
Sound Support
Works across Windows, macOS, and Linux:
# Play audio file
play('../sounds/mysound.mp3')
# Make a file of a frequency
generate(frequency, duration, name, sample_rate=44100, volume=0.5)
Local Server Support
# Starting a server and client (PORT, message)
LocalServer(1080, {'MarkTheMighty':((243,332), 57)})
An example of a returned value would be:
{'LordMinion777':((0,0), 100), 'Muyskerm':((245,334), 43)}
Terminal Input Detection
# Mouse Click Detection
terd.click() # A return value of (-1, -1) means the click was invalid!
# Keyboard Press Detection
terd.geky(times)
Encryption
# Set the table
b64.Table.table = 'ABCDEF...XYZ...12...90...!@..._+'
b64.Table.generate('ABCDEF...XYZ...12...90...!@..._+', 32) # (table: str, times: int)
# Encode and decode
b64.encode(text)
b64.decode(text)
When setting the table, it MUST include the characters that are being stored at the very least! Extra characters are suggested for security.
Links
License
pyTGM is licensed under Bspace, created by Tokyn Blast.
4.0.0 (December 17, 2024)
- Removed file.readChar
- Major fixes to all variable in main init
- Did an overhaul on Licence and README.md
- major change in file structure
- Renamed getch to geky
- Put getch inside class "terd"
- Added a click detection function
- Updated and fixed all
- Added init.py for an entry point
- Moved all and links to init.py
- Made functions satic methods
- Changed how random works
- Updated LocalServer error message
- Added a To_send variable to LocalServer
- Removed autoplay from frequency
- Fixed windows key detection
- Removed board and random
- Added security hashes
- Added badges to README.md
4.0.1 (Decmeber 17, 2024)
- Import fixes
4.0.2 (December 17, 2024)
- Click removed temporarily
- Updated build in version
4.0.4 (December 17, 2024)
- Import fixes
- Replaced 4.0.3, as it is the same
4.0.5 (Decmeber 17, 2024)
- Added back click
4.0.6 (Decmeber 17, 2024)
- Added windows implementation of click
- Fixed pybind11 missing module for pylint
- Added C++ linting
4.1.0 (December 18, 2024)
- Added *.txt to manifest.in
- Added C++ badge to github
- Updated licence
- Fixed click bugs for windows
- Distributed .tar.gz, instead of a .whl
- Removed sound.generate()
- Changed sound.play() to psound()
- Changed mod_line() to fm_line()
- Placed dummy functions for removed functions, that serve warnings
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pytgm-4.1.0.tar.gz.
File metadata
- Download URL: pytgm-4.1.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aad27abb43735a88b9da2451a9319eafa074f77836b3a445b907d888c6a41507
|
|
| MD5 |
e7e4e44a6b4a09d5671613dc8cc0082f
|
|
| BLAKE2b-256 |
9d05b6dca880467687ef8a25497f42ad36c1407b47a4f9c1d19f4fc6de882ed4
|