Jump to content
  • Advertisement

Archived

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

Lesson 19 help

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

Well last week i''ve started with the particle machine from lesson 19 and after i have finished it i wanted to make some mods.I want to have in my title bar of the window the FPS and how many particles are in the scene.With FPS i had no problem,but with particles i had a lot.I couldnt figure how to make it! Any help? Thanks

Share this post


Link to post
Share on other sites
Advertisement
It depends on what value you want to get - the total number of particles is consant - if you want to get the total number of live particles you could go through the particle array and count up how many particles that have life >= 0. Or you could just as easily count up how many particle have life < 0 and subtract form the total particles, which would be faster. The thing you have to realize though that is every particle is always drawn - as soon as you check for life < 0 you reset the particle and thus redraw it(hope that makes sence). The only thing is that these newly recreated particles dont move.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!