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

Uploaded CPython 3.14+Windows x86-64

pyroquad-0.1.2-cp314-abi3-manylinux_2_38_x86_64.whl (6.1 MB view details)

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

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

Uploaded CPython 3.14+macOS 11.0+ ARM64

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

Uploaded CPython 3.10+Windows x86-64

pyroquad-0.1.2-cp310-abi3-manylinux_2_38_x86_64.whl (6.1 MB view details)

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

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

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

Uploaded CPython 3.9+Windows x86-64

pyroquad-0.1.2-cp39-abi3-manylinux_2_38_x86_64.whl (6.1 MB view details)

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

pyroquad-0.1.2-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.1.2-cp314-abi3-win_amd64.whl.

File metadata

  • Download URL: pyroquad-0.1.2-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.1.2-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 59d045856aa27947e54b17037104f3fe19fa81e9ae6918256e8b687e6fa6eb47
MD5 9a2156a1bbfd4d384ebd803fc330d4e3
BLAKE2b-256 d70d9fa57d1960ada19d51ef9899cde1beb7cc2c4376d5eebaab253149520dfa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.2-cp314-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 a05175eaf1096af709f4737c4545efd034fa3b8c317311a7e191bc3c4541bcb6
MD5 2f255d3df6bdac58e715d4de89495111
BLAKE2b-256 aca7299bb3dea97121dda94f4dd1f07416b67dee6d5aab182e4344bf1e6ff3f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.2-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bf6f323d19cda03e04f642aff84a0c2e884120509cf13bd4f80e6eca27b2049a
MD5 43fa87990861a8d1490f531135a0f481
BLAKE2b-256 7afad71b8f19ed8b130eee8d51b8bce0106de13110c7f764f623453a5d66af31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyroquad-0.1.2-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.1.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 76ac96a8dbdb7b8c93498454905e227841605361e757fffd4734cfbb2a45cffc
MD5 790f594ce571c24f1298cac36a94c2da
BLAKE2b-256 1df86a78f0be3bbb8a15e44695793210836931c6d94f501ad89eef583436dba4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.2-cp310-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 428b66473c96ce578cb1a8c44e7f90b23eb66d0f4c81fd981221fd2afa7e5ec5
MD5 19080df6d1dee801e91b1fee6cb1337f
BLAKE2b-256 f2949768117ecc9c61a0726b7f07a6a51c207915ffd74cfacf8aae528c3ca988

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2ec8f938d05f2b11cd54495650079eebbe5aa0789c04f03b0be2e6969f33d8a1
MD5 a8db1a28794221969666dd8ede7cd357
BLAKE2b-256 d5b1af8ba23634e5329590febed2ad8f8d522a77b98a50a5b8363f368c5f20f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyroquad-0.1.2-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.1.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3138c2b3c532f3704030dadd461516661a62979e1e1d8309f138dafd61ed405f
MD5 c7fc144ed6e75dc6955ca4d19840b99b
BLAKE2b-256 6def675e855eb8746e40e7fa44c736ae33d67cf19e9bc95d4c8c0d05deaf6ba3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.2-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 21a874df693460d669d307ab7e82ee9d91bf33d00db0e31d5f15bee6fb1a4140
MD5 58e193c9bce5504fff19f0565f334e16
BLAKE2b-256 eb014afb1830c3722e175b767e99289270fbf77c379210196c0673e61ab27155

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 005fca9a18b0a5369aa81ade1231ef2b3e555b3151b9e823c5517cd9f5e77740
MD5 6eaee27bd301de35ae9ced5884a29e41
BLAKE2b-256 d4a7d7ec2853c19ec8aabcb1792dab52d6d5386315484e890dcf8d469ed2bbe8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

9 files

0.1.1

9 files

0.1.0

9 files

0.0.5

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