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

Uploaded CPython 3.14+Windows x86-64

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

Uploaded CPython 3.14+macOS 11.0+ ARM64

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

Uploaded CPython 3.10+Windows x86-64

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

Uploaded CPython 3.10+macOS 11.0+ ARM64

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

Uploaded CPython 3.9+Windows x86-64

pyroquad-0.1.0-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.1.0-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.0-cp314-abi3-win_amd64.whl.

File metadata

  • Download URL: pyroquad-0.1.0-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.0-cp314-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 cb2be19185af19ff6e9a36d685edef64c0f2a9a265fcfa58e3d7b0cf6eeec4fa
MD5 a693c5aca9c29388ddb8058332162377
BLAKE2b-256 2868e1171a376df0f0f5494f8ae23538fa125c917673ba3fe24df8f910df8c37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.0-cp314-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 a599c4151304bd06297d504400c9f02fb8bfb4e1ded76b65a0c01fc6a1017209
MD5 6d2ee1790c74ef838199239512ff7c46
BLAKE2b-256 1cca7a84f0b091f8e4a467c92ce9d801cf087a4fb70f71151903209f30b5c1f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.0-cp314-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1d76314483922e33ce746fd0023466bb762003b2d7cdab50e3f87c40234af2db
MD5 10233c6e56aa4ef03f96ed1042125d80
BLAKE2b-256 b58e47b07f919a750fce147ce77b7349652260c5b69d8eb1b3cb9f948df97d63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyroquad-0.1.0-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.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 756d393c2c4ada8c4716c88a7f23f5e4cc9acf4df42e163d724356ac7e4dfc7c
MD5 898f3dbe98df139a35b3f7fce540496a
BLAKE2b-256 665e200c92798de6723eedbfffe605bb392e0bbff22f55caff68b046d469bd16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.0-cp310-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 680601d6549116bcd1c920174bedd3129c9acca7a24f4568f0ef576f382d2a56
MD5 b797cf3bb01f7e41e7c4c7413638ec40
BLAKE2b-256 f6762c5ebf659f31cb23096c3b6f453e143923eae6d4b8fc41050ec004cb5634

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6774a60f391059349229b5fd57497f36dce4577ee20f8742264e7253ba52e567
MD5 a4eb213f0154504c6269fd032c2b18ac
BLAKE2b-256 5c084a47a20b28e02526babf5575de61f92719e34a0ae32c8bfb98766d21ca3a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyroquad-0.1.0-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.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 05147091f84fe4fbc945405946f2d58882083b078fee7e5f4c4e8a90d38f519e
MD5 0f942bc9f9ac1db826747c5783462dd8
BLAKE2b-256 259e0e4bff651b8d4714abb6bbf0593af919d4ae65e0d19363ab7e108fc83bae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.0-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 f8a5372147e194c04a49373a33defe9c67990192af7355759825f555610e856e
MD5 0499f063d1121b3262d7fb04324d9415
BLAKE2b-256 bb5a2122ef021caec19dfbdd7312a99f7d21fd2f58e1e20999e18fc2a1e3e65d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyroquad-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ab1a838ecb0d8c457f4cf23a726d9ccccedda05b3423a8613531a6db22f8465f
MD5 09224cb34bfc42ef8bfacd9c535001dc
BLAKE2b-256 e137f5a5905e8bee93cb29f1fdcc080d5e31b35f291cee8ee6c15cf46a0cdf58

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

9 files

0.1.1

9 files

This release

0.1.0 This release

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