Flocking behaviour in particles
Among the new actions added in version 1.0 are three that cause interaction between particles. These are
ApproachNeighbours which causes nearby particles to move towards each other.
MinimumDistance which causes particles to keep a minimum distance between themselves.
MatchVelocity which causes particles to adjust their velocity to match the average of all near neighbours.
By combining these actions, we can create flocking behaviour, where particles approach each other, but not too close, and match the velocity of the particles around them. I've added an example to the examples section of the site.
Posted on 10 April 2008
Version 1.0.0 released
I uploaded version 1.0.0 this morning. This version features a number of additions and a couple of key structural changes.
The structural changes are
Changes to setCounter
The counter in the emitter is now a getter/setter so rather than
emitter.setCounter( someCounter );
you need
emitter.counter = someCounter
Changes to Rendering
The rendering has been moved out of the emittter into a separate set of classes. So rather than
var emitter:DisplayObjectEmitter = new DisplayObjectEmitter(); addChild( emitter );
You need
var emitter:Emitter = new Emitter(); var renderer:DisplayObjectRenderer = new DisplayObjectRenderer(); emitter.renderer = renderer; addChild( renderer );
This allows much greater flexibility over the renderers, which is particularly important when moving flint over to use in 3D environments, which is the next stage in the project.
All the examples on this site have been updated to reflect these changes. I'll write about the new additions and add some examples to illustrate them over the next few days.
Posted on 7 April 2008
Version 0.9.4 released
Now in SVN and download. The core features haven't changed but I have added a number of new behaviours.
- Access all properties in Actions, Initializers, Counters and Activities so they can be modified while the emitter is running.
- AlphaInit initializer sets the initial alpha value for all particles
- ImageClasses and SharedImages initializers set the particle image to one selected from a group, with weighting to adjust the selection
- MouseExplosion action pushes particles away from the mouse
- MouseGravity action pulls particles towards the mouse
- TurnAwayFromMouse action causes particles to turn away from the mouse
- GreyscaleZone uses a greyscale image to define a zone, with weighting based on the luminence of each pixel
- Pulse counter emits particles in regular bursts
- PerformanceAdjusted counter adjusts the rate of particle emission if the frame-rate drops
- TwoWay energyEasing functions have an energy peak half-way through the particle's lifetime
Posted on 6 March 2008
LFPUG Presentation Slides
Yesterday's presentation at the London Flash Platform User Group went well. Everyone was very enthusiastic about Flint and I got a lot of ideas for features from the audience. Thank you to everyone who was there, and to Tink for organising it. I had a good time and I hope you did too.
The slides from the presentation are here.
Posted on 29 February 2008
Presentation about Flint in London
I'm doing a presentation about the Flint this Thursday (28 February) at the London Flash Platform User Group. As well as showing how to use Flint to create particle effects I'll be delving into the underlying code architecture and showing how to customise Flint to your own requirements. I'll also be looking at some of the specific problems I encountered and solutions I employed in developing Flint so hopefully the talk will be of interest to any developer, not just those who want to create particle effects.
Entry is free, so you can just turn up on the night. But if you sign up on the website in advance you could win a Flex or Actionscript book.
Posted on 26 February 2008
Version 0.9.3 released
I uploaded version 0.9.3 today. There's a new counter - the TimePeriod counter - which emits particles for a set period of time and then stops. Easing functions can be used to modify the rate of emission over the time period so more particles are emitted at the beginning or the end.
I also made a number of optimisations to improve the performance, particularly with particle systems containing thousands of particles.
I also modified the emitter to allow prioritising of actions. This was important for actions in which the particles react with each other.
I've added one action in which the particles directly affect each other (there will be more later). It's called MutualGravity and as the name suggests it involves the particles exerting a gravitational force on each other. I'm not sure how it will be used but it seemed like a good place to begin with these intra-particle actions. It's demonstrated in this example.
Posted on 25 February 2008
Making fire with particles
We now have two examples creating fire. The first I mentioned earlier sets fire to the Flint logo. The second creates a fire and smoke effect. Both are in the examples with full source code.
Posted on 21 February 2008
Version 0.9.2 released
I uploaded version 0.9.2 yesterday. I've made a big change to the package structure to reflect the new website - everything is in org.flintparticles instead of bigroom.flint. A couple of the classes have been renamed (all the zone classes end with the name suffix Zone, MoveEuler has become simply Move, and LineShape has become simply Line. I've added some new effects including DeathOffStage for simply removing particles when they leave the stage and two new zones, BitmapDataZone and DisplayObjectZone.
The BitmapDataZone and DisplayObjectZone enable you to use a BitmapData object or a DisplayObject object to define the area in which the emitter emits particles. The initial idea came from Julien who wanted to add particle effects to a logo. With that in mind, I used the BitmapDataZone to create this example.
Posted on 21 February 2008
First post
Hello and welcome to Flint's new home. It's early days yet but as we approach a 1.0 release I felt it was time for Flint to look after himself. There's lots to add to this site but the basics are here. Come back as often as you can; we like having you around.
Posted on 20 February 2008