Async/await-based framework for PyGame
Project description
AsyncPygame
Let's say you want to do:
print('A')
- wait for 1000ms
print('B')
- wait for a mouse button to be pressed
print('C')
in that order.
The asyncpygame
module allows you to implement that like this:
async def what_you_want_to_do(*, clock, sdlevent, **kwargs):
print('A')
await clock.sleep(1000)
print('B')
e = await sdlevent.wait(MOUSEBUTTONDOWN)
print('C')
Currently, there are no proper tutorials available. Please refer to the examples.
Installation
Pin the minor version.
poetry add asyncpygame@~0.1
pip install "asyncpygame>=0.1,<0.2"
Tested on
- CPython 3.10 + pygame-ce 2.5
- CPython 3.11 + pygame-ce 2.5
- CPython 3.12 + pygame-ce 2.5
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
asyncpygame-0.1.3.tar.gz
(9.5 kB
view details)
Built Distribution
File details
Details for the file asyncpygame-0.1.3.tar.gz
.
File metadata
- Download URL: asyncpygame-0.1.3.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.4 Linux/5.4.0-198-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83a521b8d5b76cebbe6c8ee63f485870e850973494808f9cbb1f58fe4f6d547c |
|
MD5 | 0b23f03aaf8a85df1478ac24fb62a685 |
|
BLAKE2b-256 | 47a0cfbcb93e490e56c2b1e45f415b922082588144e2d64f519082bc56a01902 |
File details
Details for the file asyncpygame-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: asyncpygame-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.4 Linux/5.4.0-198-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 485f8eefbab2dd382d188fd583b6dcfe0cfd109be4f3bb30c29af1bba3171dd0 |
|
MD5 | 50df0904870f08c543837f4406e817c8 |
|
BLAKE2b-256 | f2348879da4a9795cabd7a4bf1f758373dd00edc59269305a16993c20836be24 |