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.
Pin the minor version.
poetry add asyncpygame@~0.1
pip install "asyncpygame>=0.1,<0.2"
- CPython 3.10 + pygame-ce 2.5
- CPython 3.11 + pygame-ce 2.5
- CPython 3.12 + pygame-ce 2.5