Hi all,
I'm working on a simple particle engine in 2D, for explosions etc...
Right now when I generate an explosion, I simply have a for loop that generates 100 or more particle objects which are of a particle type which has fields, x#,y#,mx#,my#,life
Then to update and display them I update each particles coords then decrement it's life, it's deleted when life hits zero. I lock the image buffer before drawing the particles as I've found this is quicker.
Is using types a good way to do particles, or would I be better off using an array or memory bank? Also, those of you who know this stuff, is it best to update every particle every frame, or half of them?
I'm working on a simple particle engine in 2D, for explosions etc...
Right now when I generate an explosion, I simply have a for loop that generates 100 or more particle objects which are of a particle type which has fields, x#,y#,mx#,my#,life
Then to update and display them I update each particles coords then decrement it's life, it's deleted when life hits zero. I lock the image buffer before drawing the particles as I've found this is quicker.
Is using types a good way to do particles, or would I be better off using an array or memory bank? Also, those of you who know this stuff, is it best to update every particle every frame, or half of them?