GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BitFlowCodex/PyParti: A lightweight, customizable particle library for Pygame.

BranchesTags
Open more actions menu

Latest commit

 

History

32 Commits
32 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
src/pyparti
src/pyparti
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
pyvenv.cfg
pyvenv.cfg
 
 

Repository files navigation

PyParti

A fast, beginner-friendly particle system for Pygame. Rain, fire, explosions, sparks. Describe an emitter in one call and just simply let the system handle the rest.

Rain Explosion Fire

Features

  • Object pooling and image caching for low per-frame overhead
  • Burst or continuous emitters with randomized speed, direction, color, and spread
  • Shapes: rect, ellipse, circle
  • Optional gravity

Installation

pip install git+https://github.com/BitFlowCodex/PyParti.git

Requires Python 3.10+ Pygame is installed automatically.

Usage

import pyparti

system = pyparti.ParticleSystem(max_particles=5000)

system.create_emitter(
    position=(640, 360),
    direction=((-0.1, 0.1), (-10, -9)),
    speed=(25, 50),
    size=15,
    lifetime=4,
    color=[(255, 0, 0), (255, 84, 0)],
    spawndelay=0.05,
    spread=45,
)

# in your game loop
system.update(dt)
system.draw(screen)

See examples/main.py for rain, fire, and explosion presets.

Emitter options

Values marked range take a number or a (min, max) tuple.

Parameter Description
position, direction (x, y), each a range
speed, size range
lifetime Seconds a particle lives (default 3.0)
shape "rect", "ellipse", or "circle"
color Name, RGB tuple, or a list to pick from randomly
amount Particles per burst (default 50)
burstdelay Seconds between bursts
spawndelay Seconds between particles in a stream
spread Random angle offset in degrees
gravity Downward acceleration in px/s²

License

MIT. See LICENSE.

About

A lightweight, customizable particle library for Pygame.

Topics

librarypygamepython

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.