particles

Started by
1 comment, last by untalkative_monkey 22 years, 4 months ago
Hey everyone, i just made a little particle class. By creating an instance of it, you have one particle and you can control the color, gravity, position, velocity, and wind... The way I use it right now is that I have an array. PARTICLE particles[128]; I find it stupid because i can have only one particle effect at a time. Now can anyone give me a few tips on how I would alter this class, or create a kind of wrapper class that would allow for infinite particles? And please don''t tell me to make a bigger array. ...go on and live with no regrets, you only have one life...
...go on and live with no regrets, you only have one life...
Advertisement
quote:Original post by untalkative_monkey
I find it stupid because i can have only one particle effect at a time.

Create a ParticleEffect class, which maintains a (circular) list of particles (circular so that particles get recycled rather than continuously created and destroyed). Then have multiple instances of ParticleEffect.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
A cool link someone posted yesterday I think:

www.particlesystems.com

Source code, editors, discussion - all you need.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement