Archived

This topic is now archived and is closed to further replies.

This topic is 5822 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites