View Single Post
Join Date: Feb 2008
Posts: 46
Reputation: CaffeineCoder is an unknown quantity at this point 
Solved Threads: 0
CaffeineCoder CaffeineCoder is offline Offline
Light Poster

Re: 2D Java Fireworks Explosion

 
0
  #6
Feb 12th, 2008
Originally Posted by Phaelax View Post
You can use the following equation of projectile trajectory to make your explosions.

x = v*cos(a)*t
y = v*sin(a)*t - ½gt²

Keep an array of 100 or so particles that will make up the firework. Given a random velocity (v) for each particle and a random angle (a). Then just step through the time, updating their positions.

Thanks Phaelax, I'll try some of that. Was about to post something when I saw your reply so I'll hold off posting problem code until I play with that a bit more.

Thanks.
Reply With Quote