Skip to main content

PyIgnition - Beta 2

A particle effects library for Pygame


David
(animatinator)
PyIgnition is a particle effects library I'm working on for easy implementation of particle effects in Pygame programs.

Current features

  • Fully customisable particle sources:
    • Particles' starting velocities and directions can be completely controlled, and you can set random ranges for both
    • Particles per generation, and the spacing between generations, can also be easily altered
  • Fully customisable particles:
    • Six different drawtypes are available: point, line (of fixed length), scaleline (which scales with velocity), circle, bubble (an unfilled circle) and image (for which you can specify an arbitrary image file)
    • All parameters are fully customisable, from line length to bubble colour, and you can also change the particle's drawtype in real time
  • Powerful physics system:
    • Particles' paths can be influenced by an unlimited number of gravities, which can be either directed (constant in one direction) or point gravity (following an inverse square law around a point). Gravity strengths, positions and directions are modifiable and you can set a random range for strength to simulate effects like blusterous wind
    • Obstacles can be added to simulations which particles will deflect off, making effects more realistic as they appear to interact with their environments. Obstacles can be either circles, rectangles or boundary lines, all of which have fully customisable parameters
  • Highly versatile keyframe system:
    • Pretty much every single parameter can be individually keyframed in real time, allowing you to create incredibly complex effects
    • Particle keyframes can be created with sources so that they will be copied to every particle the source produces. The effects of these keyframes are then pre-calculated by the source so they needn't be worked out for every single particle, resulting in good performance even with very elaborate animations
    • Further optimisations include a function for consolidating all keyframes from past frames into one single keyframe on the current frame, which when used regularly will significantly speed up animations involving large numbers of keyframes - especially when keyframes are being constantly added by the program
    • Keyframes can use either linear or cosine interpolation, and can switch between the two mid-animation if needed
  • Unlimited number of independently-managed particle effects, each using its own sources, gravities and obstacles

Included demos

  • Bubbles.py - click to add spiffy colour-changing bubbles which gently drift off into the sky
  • Catherine wheel.py - a nifty catherine wheel effect created using a rotating source, with image particles for sparks
  • Controlled eruption.py - an elaborate animation which makes use of all the current features to show off PyIgnition's capabilities. This is also the one pictured in the screenshot
  • PyIgnition test - fire.py - The old fire demo, now with a rectangular obstacle which the flames will deflect off and wrap around in a fairly realistic fashion
  • PyIgnition.py - the original demo with line particles flying around the screen (driven slightly mad by keyframed point gravities)
  • Water.py - A rather system-intensive demo with six obstacles and many circular particles used to create a water-like effect
  • Wind.py - Initially just a demo of randomised horizontal gravity being used to create wind, this now includes a circular obstacle locked to the user's cursor which can be used to bat the stream of particles around the screen


Planned features for future releases include several new gravity types and obstacles, a file format for storing and loading particle effects (so you don't need to create them manually within your program) and a separate application for creating effects.

Usage instructions are available from here.

Links

Home Page
https://launchpad.net/pyignition
Source
http://launchpad.net/pyignition/trunk/keyframes-2/+download/PyIgnition%20beta%202.zip

Releases

PyIgnition Alpha 1 — 9 Jun, 2010

PyIgnition Alpha 2 — 12 Jun, 2010

PyIgnition Alpha 3 — 22 Jun, 2010

PyIgnition Beta 2 — 13 Jul, 2010

Pygame.org account Comments

  • Patrick Scott 2013-12-05 15:40:53

    This library is a masterpiece and I recognize the hard that went into the designing, great work!

  • ajdog7 2016-04-06 21:30:01

    I'm having trouble running the file. It's giving me TabError: etc