Metadata-Version: 2.1
Name: asyncpygame
Version: 0.1.3
Summary: Async/await-based framework for PyGame
Home-page: https://github.com/asyncgui/asyncpygame
License: MIT
Keywords: async,pygame
Author: Nattōsai Mitō
Author-email: flow4re2c@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Dist: asyncgui (>=0.7,<0.8)
Requires-Dist: asyncgui-ext-clock (>=0.5,<0.6)
Requires-Dist: pygame-ce (>=2.5,<2.6)
Project-URL: Repository, https://github.com/asyncgui/asyncpygame
Description-Content-Type: text/markdown

# AsyncPygame

Let's say you want to do:

1. `print('A')`
1. wait for 1000ms
1. `print('B')`
1. wait for a mouse button to be pressed
1. `print('C')`

in that order.
The `asyncpygame` module allows you to implement that like this:

```python
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')
```

[Youtube](https://youtu.be/kvy0_aVUFLM)  
[API Reference](https://asyncgui.github.io/asyncpygame/)

Currently, there are no proper tutorials available.
Please refer to the examples.

## Installation

Pin the minor version.

```text
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


