Skip to main content

Pyroquad Game Engine


This is a Python game engine based on macroquad.

  • Install via pip install pyroquad
  • Requires Python >= 3.9
  • Supported Platforms: windows, linux, mac, (wasm eventually)

Featuring 2D:

2D Screenshot

and 3D:

3D Screenshot

How to build:

  1. Prerequesites:

    • Python >= 3.9 ( python >= 3.14 is recommended)
    • Rust Compiler >= 1.85.0 (Required for the Rust 2024 Edition)
  2. Create and activate a Python virtual environment:

    • macOS / Linux:

      python3 -m venv .venv

      source .venv/bin/activate

    • Windows:

      python -m venv .venv

      .venv\Scripts\activate

  3. Install the maturin build tool using pip install maturin

  4. (optional) Run cargo run --bin stub_gen --no-default-features --features use-real to gennerate up-to-date python stubs in init.pyi.

    Stub generation specifically requires python >= 3.10

  5. To compile:

    run maturin build --release --features abi_39 for python >= 3.9

    run maturin build --release --features abi_310 for python >= 3.10

    run maturin build --release --features abi_314 for python >= 3.14

    (Note: Older ABIs offer better backward compatibility, but newer versions yield performance improvements)

  6. The generated package can be found at: /target/wheels/

  7. Install the package: pip install \path\to\your\file.whl --force-reinstall

For any Agents reading this:

Please refer to AI.md for best practice and an entrypoint into the engine.

Example Code:

Hello rectangle

from pyroquad import *

activate_engine()

while True:
    draw_rectangle(x=100, y=100, w=600, h=300, color=Color.GREEN)
    draw_text(text="Hello rectangle", x=200, y=200, font_size=50, color=Color.RED)
    next_frame()
    examples.limit_fps(60)

Textures

from pyroquad import *

activate_engine()

texture =  Loading.download_file(
    "https://raw.githubusercontent.com/Ludwig-000/pyroquad/main/docs/PyroquadLogo.png"
).to_Texture2D()

while True:
    draw_texture(texture)
    next_frame()
    examples.limit_fps(60)

Cube

from pyroquad import *

activate_engine()

cube = Cube(
    position=Vec3.ZERO,
    rotation=Vec3.ZERO,
    scale=Vec3.ONE,
    color=Color.RED)

cam = Camera3D(position=Vec3.splat(2), target=Vec3.ZERO)

while True:
    cam.set_camera()
    cube.rot += get_delta_time()
    draw_all_objects()
    next_frame()
    examples.limit_fps(60)

Skybox

from pyroquad import *

activate_engine()


skybox_tex = examples.loading_screen_future(
    lambda a: download_file_future(a),
    ["https://raw.githubusercontent.com/Ludwig-000/pyroquad/main/tests/HDR_blue_nebulae_2.png"],
    show_rotating_square=True
)[0].to_Texture2D()

player = examples.PlayerCamera(position=Vec3.ONE)

while True:
    if KeyCode.Escape in get_keys_pressed():
        break

    player.update()
    draw_skybox(skybox_tex)
    draw_grid(
        slices=1_000,
        spacing=1.0,
        axes_color=Color.YELLOW,
        other_color=Color.GREEN)

    next_frame()
    examples.limit_fps(60)

Multiple windows

import multiprocessing
from pyroquad import *

def task(message, color_name):
    activate_engine()
    prevent_quit()
    color = getattr(Color, color_name)
    
    while not is_quit_requested():
        clear_background(color)
        draw_text(message, 200, 200, Color.GREEN, 60)
        next_frame()
        examples.limit_fps(60)

if __name__ == "__main__":
    seq_data = [("multiple", "YELLOW"), ("windows", "BRICK"), ("using", "ORANGE")]
    for msg, color in seq_data:
        p = multiprocessing.Process(target=task, args=(msg, color))
        p.start()
        p.join()

    procs = [multiprocessing.Process(target=task, args=("multiprocessing", "BLUE")) for _ in range(5)]
    for p in procs: p.start()
    for p in procs: p.join()

Rectangle deletes itself (heartbreaking)

from pyroquad import *

activate_engine()

re = Rectangle(Vec2.splat(200), 0, Vec2.splat(100), Color.WHITE)

timer  = 120
def t(rec: Rectangle):
    global timer, re
    timer-= 1
    if timer == 0:
        del(re)
    rec.draw()

re.tick(t)

while True:
    next_frame()
    examples.limit_fps(60)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyroquad-0.0.4-cp314-abi3-win_amd64.whl (4.9 MB view details)

Uploaded CPython 3.14+Windows x86-64

pyroquad-0.0.4-cp314-abi3-manylinux_2_38_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.14+manylinux: glibc 2.38+ x86-64

pyroquad-0.0.4-cp314-abi3-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

pyroquad-0.0.4-cp310-abi3-win_amd64.whl (4.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

pyroquad-0.0.4-cp310-abi3-manylinux_2_38_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.38+ x86-64

pyroquad-0.0.4-cp310-abi3-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

pyroquad-0.0.4-cp39-abi3-win_amd64.whl (4.9 MB view details)

Uploaded CPython 3.9+Windows x86-64

pyroquad-0.0.4-cp39-abi3-manylinux_2_38_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.38+ x86-64

pyroquad-0.0.4-cp39-abi3-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

File details

Details for the file pyroquad-0.0.4-cp314-abi3-win_amd64.whl.

File metadata

  • Download URL: pyroquad-0.0.4-cp314-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.9 MB
  • Tags: CPython 3.14+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for pyroquad-0.0.4-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 201cddb38b6125dd728f292b9c71777a4962d77964793cbe4be0842a90548e13
MD5 a11e3f6f3c43dbb20d5354745de0abfe
BLAKE2b-256 afb9d045279567539ddb5ebbd03e9acf9f5a4d70a23fca734f8cc2211312f132

See more details on using hashes here.

File details

Details for the file pyroquad-0.0.4-cp314-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for pyroquad-0.0.4-cp314-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 21baecfc9762578ba8123bfa98fb25ab99c9a76fe770698ea4f52314674fbb7d
MD5 d923ee18b419a65d8e864df416428715
BLAKE2b-256 403770087627dea31044fb6ed3832a80e163311a2227b96e95ee831bc98415ef

See more details on using hashes here.

File details

Details for the file pyroquad-0.0.4-cp314-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyroquad-0.0.4-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4ec12d394244caa83afd0fee8000f5f96899502071519b79ca4f4bd97d5523aa
MD5 9de45f05d111599927275982c04c65b4
BLAKE2b-256 6516c2209c61823afd83e98229f5b2bc0300be74cb7b4cb176399c5b04636bcb

See more details on using hashes here.

File details

Details for the file pyroquad-0.0.4-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: pyroquad-0.0.4-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.9 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for pyroquad-0.0.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b10dcec55ac00a0d9ba66bb8fc14637368f2d1a052d94d8b3b37329c826e0255
MD5 7c229fe151fa8329b146938014f0d0ee
BLAKE2b-256 0435d51e9812453afe283103605f212353e85a4e7534e6297839f3ec034e085a

See more details on using hashes here.

File details

Details for the file pyroquad-0.0.4-cp310-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for pyroquad-0.0.4-cp310-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 de6f61fd74a25bc738ee0a71b06f1fd95bd75a5f09686d46442367d5d10432dd
MD5 9249e70abacac01546b5ca394036c251
BLAKE2b-256 785ad0b9cf1b7497be5c75e4bc94c8fd39b50379e1ad7edaa5247d43ad823c24

See more details on using hashes here.

File details

Details for the file pyroquad-0.0.4-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyroquad-0.0.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 18a83ec9d173015760aa236a2e21206ae037c0cf6af301f7bc38659d88633c72
MD5 c36e417e061c17ad12de09c84cb8a071
BLAKE2b-256 9f22e30ee4c0ad96a07fdc88b142f2484e8104090f5f4a5fa7f4a97d5455fbfa

See more details on using hashes here.

File details

Details for the file pyroquad-0.0.4-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: pyroquad-0.0.4-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.9 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for pyroquad-0.0.4-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4c7791907dab2b7836daf9a95411438e66554670cc1e7f087ae694f8cf3129f9
MD5 26559cfe1280f61a441077a1ef591b25
BLAKE2b-256 5202254687d5210cec8452bba26140b0903750257b42112f093b625382ce66cd

See more details on using hashes here.

File details

Details for the file pyroquad-0.0.4-cp39-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for pyroquad-0.0.4-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 f749e7c5430df4691929434c53c34e462eb9bba2ce11a8f0d65ba074f2ea7583
MD5 322ee34896255d38236d4f15f3c197b9
BLAKE2b-256 c9e286e02346d4559321fe11f765dc4358e0437d04172b85a9f7f26c43660ce6

See more details on using hashes here.

File details

Details for the file pyroquad-0.0.4-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyroquad-0.0.4-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b4cba86cbad4737b6a6ea21417c5cdd499fcaf6706cbc0cea389eb5222c9e17
MD5 300b21b2f6ebb195e1de46650f6bd9a7
BLAKE2b-256 88c319dc02165055c5c246e25cb66862bedd6e8bdccafba94383abd5a9d2b405

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

9 files

0.1.1

9 files

0.1.0

9 files

0.0.5

9 files

This release

0.0.4 This release

9 files

0.0.2

9 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page