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.5-cp314-abi3-win_amd64.whl (4.9 MB view details)

Uploaded CPython 3.14+Windows x86-64

pyroquad-0.0.5-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.5-cp314-abi3-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.14+macOS 11.0+ ARM64

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

Uploaded CPython 3.10+Windows x86-64

pyroquad-0.0.5-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.5-cp310-abi3-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

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

Uploaded CPython 3.9+Windows x86-64

pyroquad-0.0.5-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.5-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.5-cp314-abi3-win_amd64.whl.

File metadata

  • Download URL: pyroquad-0.0.5-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.5-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c74558fa8342330cd7ba7a0f80179e8285380aa7b77dfe660c21535e8272f584
MD5 dc81a16c64fe1ccf09e6bcf807cce214
BLAKE2b-256 c98ccb8730cbf811731fd6e2189286e23940d5918c0a65d936ead3b5b988300c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.0.5-cp314-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 74d9c95fa7665e7d260785b28216f617d03c173983bbebb42740aa46a540d14e
MD5 5c6599ff46b8924cc0c7d345380d9454
BLAKE2b-256 8f5e4e8ead87efc195532beaf6ff8052bb69a39a13aba1af503c83ee9911ab56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.0.5-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6903ec25b3d065800f6407218616d9f7e559c2594efcf1b34a3a37f34080562b
MD5 58063613335787b41fb37ceea2a30580
BLAKE2b-256 c20a74fbf37db3e482666f6a20aa347283687f72ed1b0d9ccf42f688ecbd68cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyroquad-0.0.5-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.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3f1f7c458ab7b0a4b390bf93e20abf8d3f4f9258fd06a127aedcd9c660332bc7
MD5 0198bcafdcc13f3aaecfdafc6e4efe91
BLAKE2b-256 4ea1b1a6bb2d2491d9a77729bfb4f9e6c1a3872fc51537ce6a8d041c293d329f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.0.5-cp310-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 0e58aaa05b2e10bc8d2ff0bb6af28c99115ebd2a13bc4f8e59eac367518012b7
MD5 77fde75147752187a3a8618f25a83d45
BLAKE2b-256 1f8eaa7f57ff2e8d2e13e049554fd9bc9331a09b096cf6d3d8ba00bb1ee7fbe4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.0.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 15c92fc778f8c18c15ea23793419d2cb7220e259f08dc3b2132a7a6345bd8faa
MD5 12f3a3c4c73c22f007f73c3e602adf2d
BLAKE2b-256 8b81d9c756a2c1bdb361e3eaf45bc797d0dac7cf395f52aa3d58acf91dff9898

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyroquad-0.0.5-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.5-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8a12d018b9c0b7c24650c71f1ff642e228d0a8aebefc82d6689aeaf1256d9090
MD5 d6d9d8adb515fe651d861c46a75e6f28
BLAKE2b-256 c6000662df618d949cb2f07f6d8aea27f707d4ec9ec3d8251cd7334fa3a656d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.0.5-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 c63e44bcf56dd56e0e0745f494a8d4f1328d3208373c834c1864b16530c74d63
MD5 185f331b81937526aba2f9a0fd6d4a41
BLAKE2b-256 3391caef3f3ac6e1fa6d8766c941d11ecf9f4e87ac7c95acd2a6eb83d3772672

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.0.5-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 abc035c6ffc5fa34d575994632448cc58198c50912a728a77d4c041c9df7c95b
MD5 b1fa4d13e009708a1427191750d442c2
BLAKE2b-256 fc62b582cee4c9e5262c30eeb332c21a75db2a2da66eeb7986d4533c0ada565f

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

This release

0.0.5 This release

9 files

0.0.4

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