We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey, I'd like to make an explosion effect for a game I'm making. The image is about 20 pixels w/h so I'm not looking for anything huge.
I'd like to make it radiate outwards and fade from a central point, but I can't think of how to.
Any help is appreciated.
Thanks
Answers
ok...
that's hard...
start by loading and displaying an image . Do you got that?
to do
since you want to move pixel separately:
look into particle systems
e.g. in shiffmans book http://natureofcode.com/book/chapter-4-particle-systems/
OOP
then have a class Particle and an Array particles consisting of objects of that class
then transfer each pixel to a particle (preserving position and color, and assigning speed and directions) - read out the image pixel by pixel and each time say something like
particles[k] = new Particle(x,y,colorOfThatPixel, speedX,speedY);
then start the explosion by animating and drawing each particle in a for-loop
post your code, then we can look into fading out