Skip to main content

pgzhelper (pgzhelper_rw)

PyPI version Documentation Status License: LGPL v3

pgzhelper_rw is an enhanced helper library for Pygame Zero. It brings Scratch-like intuitive actor controls, frame-by-frame sprite animations, real-time image manipulations, and comprehensive 2D collision detection algorithms to your game projects.


📚 Documentation / 공식 문서

Full documentation in English, 한국어 (Korean), and O'zbekcha (Uzbek) with comprehensive API references and tutorials is available at:

👉 https://pgzhelper-rw.readthedocs.io

  • User Guides: Getting started, screen controls (fullscreen/windowed), and mouse visibility.
  • Actor Complete Guide: Scratch-style movement (move_forward, point_towards), sprite animation, speech balloons (say), trail drawing (brush_*), and dynamic hue shifting (add_hue).
  • Collision Guide: Collision detection between Points, Lines, Circles, AABB Rectangles, and OBB (Oriented Bounding Box) Rectangles, with high-performance plural query functions.
  • API Reference: Detailed class and function specifications.

🚀 Installation / 설치

Requires Python 3.7+ and Pygame Zero 1.2+. Install from PyPI via pip:

pip install pgzhelper_rw

🎮 Quick Start / 빠른 시작

Importing pgzhelper automatically enhances Pygame Zero's standard Actor class with extra superpowers.

import pgzrun
from pgzhelper import *

WIDTH = 800
HEIGHT = 600

alien = Actor('alien')
alien.pos = 400, 300

def update():
    # 1. Look towards the mouse position and move forward (Scratch style)
    alien.point_towards(pygame.mouse.get_pos())
    alien.move_forward(3)

def draw():
    screen.clear()
    alien.draw()

pgzrun.go()

💡 Key Features / 주요 기능

1. Scratch-style Actor Movements / 직관적인 이동 및 회전

actor.move_forward(5)            # Move forward in the direction of current angle
actor.move_back(5)               # Move backward
actor.move_left(5)               # Strafe left
actor.move_right(5)              # Strafe right
actor.point_towards(target)      # Point towards another actor or (x, y) coordinates
actor.distance_to(target)        # Calculate distance to target
actor.move_towards(target, 4)    # Move directly towards target

2. Sprite Animation & Image Effects / 애니메이션 및 이미지 효과

# Frame-by-frame sprite animation
actor.images = ['walk_1', 'walk_2', 'walk_3']
actor.fps = 10
actor.animate()

# Scaling & Flipping
actor.scale = 1.5                # Scale sprite size
actor.flip_x = True              # Flip horizontally
actor.flip_y = False             # Flip vertically

# Real-time Hue Rotation (NumPy accelerated & cached)
actor.add_hue(30)                # Shift color hue by +30 degrees (e.g. on bullet hit)
actor.hue = 180                  # Set specific hue angle (0 ~ 360)

3. Speech Balloons & Trail Drawing / 말풍선 및 궤적 그리기

# Display speech bubble above the actor
actor.say("Hello World!", width=150, height=40, fgcolor='black', bgcolor='white')

# Brush trail drawing as the actor moves
actor.brush_init((800, 600), thick=3, color='yellow')
actor.brush_start()

4. Comprehensive Collision Detection (Collide) / 강력한 충돌 감지

Supports accurate collision checks between Points, Lines, Circles, AABB Rectangles, and OBB (rotated) Rectangles.

from pgzhelper import Collide

# Single collision check: Circle vs Point
if Collide.circle_point(cx, cy, radius, px, py):
    print("Collision detected!")

# High-performance plural collision check: Circle vs list of Points (e.g. bullets)
hit_index = Collide.circle_points(player.x, player.y, player.radius, bullets)
if hit_index != -1:
    print(f"Hit by bullet index: {hit_index}")
    del bullets[hit_index]

Metadata

Release files for pgzhelper-rw 1.0.13

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

Source distribution (sdist)

Source distribution for pgzhelper-rw 1.0.13
File Size Uploaded Provenance Actions
pgzhelper_rw-1.0.13.tar.gz 28.0 kB With provenance Details for pgzhelper_rw-1.0.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pgzhelper-rw 1.0.13
File Interpreter ABI Platform Actions
pgzhelper_rw-1.0.13-py3-none-any.whl Python 3 none any Details for pgzhelper_rw-1.0.13-py3-none-any.whl

Total release size: 53.8 kB

Release files / pgzhelper_rw-1.0.13.tar.gz

Download URL pgzhelper_rw-1.0.13.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2494ac0d40793e7aa953db990da6eddd11a7bf498a87512b7fcaa54e1da1eae8
BLAKE2b-256 checksum
How to use checksums
2029afd69f320d514ca54c799f0329ee3250e41491f5b819f2eaa3e56eeb7c11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Release files / pgzhelper_rw-1.0.13-py3-none-any.whl

Download URL pgzhelper_rw-1.0.13-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83d8dac03a4206caa6ff2f44a21d5cd765a182db4af9f3f790689b9ca2d836fa
BLAKE2b-256 checksum
How to use checksums
8a8b8a5be36a6610283f37e22becd7245861d07e731f1d3c2c2e5b3fd43352c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for pgzhelper-rw 1.0.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pgzhelper_rw-1.0.13.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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