Jump to content
  • Advertisement
Sign in to follow this  
ChipChip

Can someone give me some ideas?

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

Hello there, i am a beginner programmer and i just learned openGL a week ago. Now i am writting a firework program, my firework is running well now but there is still onething i dont know how to do, this is: How to make the firework explode more than 1 time ?( i mean after exploded into parts, those parts will explode again, i often see this in firework show) So please, can u give me an idea of how to do this?

Share this post


Link to post
Share on other sites
Advertisement
If you use OOP, you can have a class Firework, and e.g. a function Firework.Explode() would create five more instances of Firework, which would explode again and so on.... You can have all those instances in arrays or you can allocate memory dynamically. For example, each 10th program loop can execute function Explode() of every Firework.
I hope I understood you correctly.

Share this post


Link to post
Share on other sites
Oh yes, despite my bad English, you understood what i wanted to say quite correctly ^.^. I am only using normal programming (because i am quite a beginner) with a particle struct, a firework struct consists of particles and some functions like SetupFirework(i), FireworkExplode(i)(explode the firework into its particles) (in which "i" is the index of the firework).
I think i understand the idea you gave me...but...i will have to write a new function which is different from my FireworkExplode(i) to make a firework blow into its sub-firework, right?
Thanks alot and sorry if i asked stupid question ( and i will be very happy if anyone can gimme a sample code for this)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!