Async library for PyGame
Project description
AsyncPygame
Let's say you want to do:
print('A')
- wait for 1000ms to elapse
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')
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.1
- CPython 3.11 + pygame-ce 2.5.1
- CPython 3.12 + pygame-ce 2.5.1
Project details
Release history Release notifications | RSS feed
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.1.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for asyncpygame-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f72e04743f2a6d3a48b1600f92a6f73481fa9ec4890d4c86eb1d8884edaa30e4 |
|
MD5 | 34db49b13c342031e6cdc57ce0b7798a |
|
BLAKE2b-256 | dec65704b2d73476e751627908c5f103e551213b9476c8669afc4b3717b1c305 |