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.
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.
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.
Changes
Release notes
This is a minor yet vital release which adds a few much-needed improvements to the initial 'Controlled Eruption' release and includes the new Controlled Eruption demo.Changelog
- Added a function to consolidate keyframes up to a point, so as to prevent constant memory usage growth in programs which set particular variables on every frame Added an argument to CreateKeyframe() functions which allows the user to specify the interpolation type
- Fixed a bug which caused a crash whenever a particle was located at an obstacle's origin point
And the release notes for Beta 1, which I forgot to post here:
This release implements the new keyframing system which allows implicitly separate keyframing of variables whilst extending keyframing to obstacles as well. It also introduces a significant speed improvement in particle keyframing, as keyframed particle values are now pre-cached.
I'm also pleased to say that the first version of the pdf user documentation is finished - you can download it from here.
Links
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