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

Uploaded CPython 3.14+Windows x86-64

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

Uploaded CPython 3.14+macOS 11.0+ ARM64

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

Uploaded CPython 3.10+Windows x86-64

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

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

Uploaded CPython 3.9+Windows x86-64

pyroquad-0.1.1-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.1-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.1-cp314-abi3-win_amd64.whl.

File metadata

  • Download URL: pyroquad-0.1.1-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.1-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4814315d86ba62f8aceb3a894493324651db392f8ffd662ee6fd1a81daed8a03
MD5 e27a735092861eced2e154faed7e9288
BLAKE2b-256 bfa4d7d2a7bf188a56de4420241dd69d7af81cfb385ab78dccc72f70b7e9ba49

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.1-cp314-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 e57c952e89593503da97f2e4561e6d9f8fbf458bf4b1f9a7e1745bd8cbe5b29a
MD5 9ca542c252c8788e729c9b375ff86f02
BLAKE2b-256 9c24cf8de739469b187117b1eafab9730f19bd05f7a6e2f24a37def7316788de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.1-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9fa6d431695cf8e458bc5263aa6ee10e73436d7181f9dbfb3bf2a42128385d23
MD5 8b3d59a0bf0ca5431aedbdd70370fa97
BLAKE2b-256 3aa63bebdf3c942758ef56c22e7b505942591df550749eb432cf74c5574d0877

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyroquad-0.1.1-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.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1f6a05091ee07386d615f8fc9653ef89341cd6ffa6e15cbf9540074eb86bd7eb
MD5 20fcd36c7c937561848673b2b4c97059
BLAKE2b-256 36db15026016768b6cb7994898fc28490f75e7176221bfb096636fb210f14f2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.1-cp310-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 bb51ece35f88fb8d295f46e2fb23494d33babd338d184c1ae3c430088956e99f
MD5 90f0832bc4cf77d2f5d15ccee06d5b2a
BLAKE2b-256 e985027425e66dcd7228a3af01a79620bb23f59dc6750ef23f68486a28a631c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e9f87c5e0a8a1a3e82e9b60b53d98141a863a8603bcbc8e6754f453983198f04
MD5 d5539229fcfd9f976110293945ad1ebe
BLAKE2b-256 802889a33d95f796b652e70523d8cb0c43472d68aa8a43f15dab26ec46bd2e7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyroquad-0.1.1-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.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 103cdfe142e8335603a46e8f986723340dde274f861fdc5783ccf1b9b5395c81
MD5 72d09ae04839ea60e0324cbef1e8ff71
BLAKE2b-256 7f201dda05b798e0c51d895d5268739c473a24058a895b8281286a147515af82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.1-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 0028a0799b320413c5897b73049166792acbe29074e62fd3b4cdea790b2a67e0
MD5 0a6828b2f00fb125517452c90064f055
BLAKE2b-256 89da6e98c6c7291a020cdce2bc58a7e6d50bdb132f6baa5654cf561e003c0b88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8019111e6fdab9019d70db47b2142a75f859ff4b88103ba76e0b7a64d9d5e2ee
MD5 bc32bf0ebc62295defbc2d7b183aa2e8
BLAKE2b-256 cdf68a82ac46e18ddd96ecafe1c306f28b4b33561e918d0a2ac8359134fd5739

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

9 files

This release

0.1.1 This release

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