is there anywhere...

where there are listings of code for different types of 2d fx? like fire, explosions and stuff?

thanks.

i have some examples by “javaextreme”

fire, plasma, explosions (particles+blurring) nice stuff :wink:

try a google run :slight_smile:

Thanks, i looked on google and found some of those things like javaboutique.

do u know of any tutorials that cover the subject of creating images, and/or making transitions of images, like one image fades to another one?

I will look on google, but if there are any good ones i should pay attention to, thatd be great

There is some good stff here, not sure if it covers what you want.

http://freespace.virgin.net/hugo.elias/graphics/

here’s the code i use to make translucent images


public Image[] makeTranslucentImages(Image[] src) {
            Image[] transImages = new Image[src.length];
            int width = src[0].getWidth(null);
            int height = src[0].getHeight(null);
            for (int i = 0; i < src.length; i++) {
                  int[] pixels = new int[width * height];
                  PixelGrabber pg = new PixelGrabber(src[i], 0, 0, width, height, pixels, 0, width);
                  try {
                        pg.grabPixels();
                  }
                  catch (InterruptedException e) {
                        logger.error(getClass(), "Error grabbing pixels.");
                  }

                  for (int k = 0; k < pixels.length; k++) {
                        int alpha = (pixels[k] >> 24) & 0xff;
                        if (alpha != 0)
                              pixels[k] = 0x4F000000 | (pixels[k] & 0x00FFFFFF);
                  }
                  transImages[i] = Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(width, height, pixels, 0, width));
            }
            return transImages;
      }

i actually use it for motion blur on my sprites :smiley: