Skip to main content

Async library for PyGame

Project description

AsyncPygame

Let's say you want to do:

  1. print('A')
  2. wait for 1000ms to elapse
  3. print('B')
  4. wait for a mouse button to be pressed
  5. 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')

Youtube

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


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)

Uploaded Source

Built Distribution

asyncpygame-0.1.1-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page