Jump to content
  • Advertisement


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


2D particle systems

This topic is 6610 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

can anyone give me an example of 2D particle systems that you could use for say bits of fire in an explosion or for pieces of an item when it breaks? i''m trying to give my 2D engine a bit more realism, and i thought that a particle system would be the best way to do it. thanks, david

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Look at this site http://freespace.virgin.net/hugo.elias/models/m_main.htm
there''s a lot of informations.

Share this post

Link to post
Share on other sites
Hi neonstar,

I will do my best to help you, but i''ve not yet finished my PSystem 3D.

First you need an array of Particule. I''ve defined it like this

Point2d Position; //Position of particle vs emitter
CVector Momentum; //Force apply on a particule

CMesh *Object; //I have add that for PSystem with a mesh
// like pieces of glass flying around

Then, you defined a Emmiter for those particules

Point2d Position; //Position of emitter in the world
CVector Orientation; //Orientation of emmiter (where
//particules go)

float fSpray; // The Angle of the Emitter Spray

float fTimeBirth; //How long to wiat for another birth
float fBirthTresh; // --

float fLifetime; //How long a particule last..
float fLifeTresh; //I dont want particules to die at the
// same time

float fRandom;

DWORD NbMaxParticules; //Maximum count of particules
LList ListParticules; // A LinkedList Contaning a List of
// all Particules

All variables with ''Tresh'', which stand for ''Treshold'', are number to give each PSysteme behave differently.

Like i told you before, i''ve not completed my implentation yet.
But u can what some other things in your DataStruct to make your PSystem make efficent or with more F/X.

You will need a bunch of function to make a usefull use of your PSystem.

void Emitter::AnimateSystem (float fTimeSlice)
MakeBirth; // Check if its the right time to add a Particule
// - Birth Time Reach, NbParticule <
// MaxParticules

AnimateParticule; // Animate each particule with is own force

You will nedd disply it too, to do that simply parse the LList and show Particule at their respective position

Just hope this with help you...


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!