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)

    • System libraries if using Linux (required for X11, OpenGL, and audio bindings):

      Ubuntu / Debian: sudo apt-get install -y libasound2-dev libx11-dev libxi-dev libgl1-mesa-dev libxcursor-dev libxinerama-dev libxrandr-dev

      Fedora: sudo dnf install alsa-lib-devel libX11-devel libXi-devel mesa-libGL-devel libXcursor-devel libXinerama-devel libXrandr-devel

      Arch Linux: sudo pacman -S alsa-lib libx11 libxi mesa libxcursor libxinerama libxrandr

  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. Compilation:

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

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

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

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

  5. Installation:

    • The generated package can be found at: /target/wheels/
    • 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)

Metadata

Release files for pyroquad 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pyroquad 0.1.3
File
pyroquad-0.1.3-cp314-abi3-win_amd64.whl CPython 3.14 abi3 Windows x86-64 Details
pyroquad-0.1.3-cp314-abi3-manylinux_2_38_x86_64.whl CPython 3.14 abi3 Linux glibc 2.38+ x86-64 Details
pyroquad-0.1.3-cp314-abi3-macosx_11_0_arm64.whl CPython 3.14 abi3 macOS 11.0+ ARM64 Details
pyroquad-0.1.3-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
pyroquad-0.1.3-cp310-abi3-manylinux_2_38_x86_64.whl CPython 3.10 abi3 Linux glibc 2.38+ x86-64 Details
pyroquad-0.1.3-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
pyroquad-0.1.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
pyroquad-0.1.3-cp39-abi3-manylinux_2_38_x86_64.whl CPython 3.9 abi3 Linux glibc 2.38+ x86-64 Details
pyroquad-0.1.3-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details

Total release size: 48.7 MB

Release files / pyroquad-0.1.3-cp314-abi3-win_amd64.whl

Download URL pyroquad-0.1.3-cp314-abi3-win_amd64.whl
Size 4.9 MB
Tags CPython 3.14 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
f228149a8a10e5b827fc3c4850f0355359d2dfd83880783c5b5a21ac23961671
BLAKE2b-256 checksum
How to use checksums
5abe464de4e5f548b12b0f145bd14dbbce480ea1df6a77c1985993d444e4e3d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / pyroquad-0.1.3-cp314-abi3-manylinux_2_38_x86_64.whl

Download URL pyroquad-0.1.3-cp314-abi3-manylinux_2_38_x86_64.whl
Size 6.1 MB
Tags CPython 3.14 Linux glibc 2.38+ x86-64 abi3
SHA-256 checksum
How to use checksums
63e8b0e4cda1d06812c6265db5202da6954b77ce97f328886e94e5930674af5f
BLAKE2b-256 checksum
How to use checksums
95818750b6560116719c6c2ed66e0d3404c9c0b5719e7fda2015ec143932f5b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / pyroquad-0.1.3-cp314-abi3-macosx_11_0_arm64.whl

Download URL pyroquad-0.1.3-cp314-abi3-macosx_11_0_arm64.whl
Size 5.1 MB
Tags CPython 3.14 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a7e9a951841352183bee8887b15f2749b7ea7b612c8d975f6424fc765807b959
BLAKE2b-256 checksum
How to use checksums
a26640a4dd6b3601fa2b1e22c82be55681de41d619e58ba32724dde459a6c77a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / pyroquad-0.1.3-cp310-abi3-win_amd64.whl

Download URL pyroquad-0.1.3-cp310-abi3-win_amd64.whl
Size 4.9 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
b018aeab6f2ec7ded73d1c4b24f3fee22a01d5914cc4618a4f2072f743b07653
BLAKE2b-256 checksum
How to use checksums
0da7a0c9364e912afa418002bdaddd4c490bf3a1c2ee05224ac7097015dd86f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / pyroquad-0.1.3-cp310-abi3-manylinux_2_38_x86_64.whl

Download URL pyroquad-0.1.3-cp310-abi3-manylinux_2_38_x86_64.whl
Size 6.2 MB
Tags CPython 3.10 Linux glibc 2.38+ x86-64 abi3
SHA-256 checksum
How to use checksums
fd75af3332f68d09b162809a9d2edaea346391d0959a3315a406f8223456a43b
BLAKE2b-256 checksum
How to use checksums
0d3d98c2c67c5725c33bc36e4df22cb2d6cefbcb050dc4aaa9de4a672b4486ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / pyroquad-0.1.3-cp310-abi3-macosx_11_0_arm64.whl

Download URL pyroquad-0.1.3-cp310-abi3-macosx_11_0_arm64.whl
Size 5.1 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
acde9ef55078ef6bf3bd09ccc361d1fadecfd74b228b298b30f5c62b2a544009
BLAKE2b-256 checksum
How to use checksums
52a8c577e0fede3b8086bc8ec68761d62c713b133374eb3cb922c2afc45bc7ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / pyroquad-0.1.3-cp39-abi3-win_amd64.whl

Download URL pyroquad-0.1.3-cp39-abi3-win_amd64.whl
Size 4.9 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1339241a304a9b40abfdaf1140a2546ed8184dc180d354fa90520efda3c6e050
BLAKE2b-256 checksum
How to use checksums
706c55d9c50fa750da0f7aa7831f0e82a9fe5a324e1e96fe0905b9d50129a4eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / pyroquad-0.1.3-cp39-abi3-manylinux_2_38_x86_64.whl

Download URL pyroquad-0.1.3-cp39-abi3-manylinux_2_38_x86_64.whl
Size 6.2 MB
Tags CPython 3.9 Linux glibc 2.38+ x86-64 abi3
SHA-256 checksum
How to use checksums
ffe72975c241bcf78ab892e07f436df6042446a328efa085657ffb8944aa0700
BLAKE2b-256 checksum
How to use checksums
379f70ded2a7ad7aefac621719a9260cf1343e57e947ee398895d974e9f04ce9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release files / pyroquad-0.1.3-cp39-abi3-macosx_11_0_arm64.whl

Download URL pyroquad-0.1.3-cp39-abi3-macosx_11_0_arm64.whl
Size 5.1 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
852a3da6f92433f9a7b3c9ab78857ed5de5a9d0575266067bf938afd616ae29f
BLAKE2b-256 checksum
How to use checksums
5f4a634852dd707eda6b099992dfba7f89ad5088efaafb14ad68ed4fb54cba5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

Release history Release notifications | RSS feed

0.1.8

10 release files

0.1.7

10 release files

0.1.6

10 release files

0.1.5

9 release files

0.1.4

9 release files

This release

0.1.3 This release

9 release files

0.1.2

9 release files

0.1.1

9 release files

0.1.0

9 release files

0.0.5

9 release files

0.0.4

9 release files

0.0.2

9 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page