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.4

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.4
File
pyroquad-0.1.4-cp314-abi3-win_amd64.whl CPython 3.14 abi3 Windows x86-64 Details
pyroquad-0.1.4-cp314-abi3-manylinux_2_38_x86_64.whl CPython 3.14 abi3 Linux glibc 2.38+ x86-64 Details
pyroquad-0.1.4-cp314-abi3-macosx_11_0_arm64.whl CPython 3.14 abi3 macOS 11.0+ ARM64 Details
pyroquad-0.1.4-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
pyroquad-0.1.4-cp310-abi3-manylinux_2_38_x86_64.whl CPython 3.10 abi3 Linux glibc 2.38+ x86-64 Details
pyroquad-0.1.4-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
pyroquad-0.1.4-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
pyroquad-0.1.4-cp39-abi3-manylinux_2_38_x86_64.whl CPython 3.9 abi3 Linux glibc 2.38+ x86-64 Details
pyroquad-0.1.4-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details

Total release size: 49.2 MB

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

Download URL pyroquad-0.1.4-cp314-abi3-win_amd64.whl
Size 5.0 MB
Tags CPython 3.14 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2c29183729c2653461c449ae8ab04c1e19c028c47f50e2454d47dfe3dda36a2a
BLAKE2b-256 checksum
How to use checksums
51c35c9579582f6e5eed91ba82ccd1d9fa12647a86b0de9b32fec1668e32a49a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

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

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

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

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

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

Download URL pyroquad-0.1.4-cp310-abi3-win_amd64.whl
Size 5.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7432ad1d3a4a969e4f86e34367b7ffd0418adce305a645be5b6c98c361166f36
BLAKE2b-256 checksum
How to use checksums
7a2491272d5cd79a83a2e5d33ac3c521390ac2e51425da2bb65ff96022fcca17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

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

Download URL pyroquad-0.1.4-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
517afbb406250b6466a8112a35ba33689743de076d40b79abf4219488c72a7b9
BLAKE2b-256 checksum
How to use checksums
08bcd935d4116dfef972ab04223a7a2ec04090f543e590deb6613d04b98011a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

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

Download URL pyroquad-0.1.4-cp310-abi3-macosx_11_0_arm64.whl
Size 5.2 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2c1b1257b66432ea56be88eb60a3a69f32b3a658e343126f2cdedf857b0ec5b9
BLAKE2b-256 checksum
How to use checksums
24f4aaff4e9036a1854d5a93a01c859ef95fec0d853cd0127275a8c3ade4bcf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

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

Download URL pyroquad-0.1.4-cp39-abi3-win_amd64.whl
Size 5.0 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
eb556a953b7cc3e86b50a78e58327ecfd475f92b304752c7625b267c58d60a24
BLAKE2b-256 checksum
How to use checksums
8d5ae24f8dcb31d78e065fb142ca8312b9e45eb33d7b53d4744dec669112c2b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

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

Download URL pyroquad-0.1.4-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
851b6296ed5e1dae94797048ac7576ff5897fbe5a8db21f9fd62f8b6937fe506
BLAKE2b-256 checksum
How to use checksums
018682dbd8c9289ba829e108dfd754854a42a282518aa458c9362fef04e57eda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.15.0

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

Download URL pyroquad-0.1.4-cp39-abi3-macosx_11_0_arm64.whl
Size 5.2 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
77380cf1ad959a2190d41b618acfce0cdfd4b4d80c89cd599eea2e616598fddf
BLAKE2b-256 checksum
How to use checksums
8f99059047f3e4fbbfcf7667ea368998d5693f70a5d0424e286b8512c175bc82
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

This release

0.1.4 This release

9 release files

0.1.3

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