Tony Polinelli
Tarwin Stroh-Spijer

contact [at]
touchmypixel.com

6/25 Easey Street
Collingwood, 3066
Vic, Australia

+61 3 8060 5321

Playing with Particles

For a new game I’m designing, I’ve been learning a little about particles. Its actually really simple to get some great effects. I found a good as3 lib http://flintparticles.org – but in the aim of learning, and due to the fact that i need to use haxe not as3 (planning to target iphone) i’ve started from scratch. Ive only implemented a Gravity Well, and Gravity – but plan to add some magnets, simple collisions, brownian motion and maybe particle to particle attraction.

A few important things are:

  • Rendering direct to bitmap- not using MovieClip or Sprite – as they kill performance
  • Using copyPixels over draw – again for performance
  • Using an Object Pool, for less memory and garbage collection issues in the future
  • Created an ‘effectors’ interface for applying multiple effects to particles
  • Frame independant (time based) motion for more predictable performance

so lets see a test:

Update: Here’s another example – not in the source, but just adding a colorTransform- fun fun!

heres the haxe code: download

cheers,

Tony

2 comments


  1. Hi cool stuff dude, but you should really try to make your SWF’s click to activate and disable the loop when the mouse leaves the stage.

    I just had to kill my browser,

    Keep up the good work
    Cheers mate


  2. yes- i’ll have to look into the easiest way of doing that. sorry :P

 

Leave a Reply

Our Friends:

Powered by haXe / poko cms | Copyright 2008-09 TouchMyPixel