The game should run fast enough in Java, even on a 500Mhz Athlon (not to mention the computer you have now).
I know practically nothing about particle effects, but I know some tidbits about Java that might help.
I guess you have a BufferedImage for the whole screen that you draw to and then draw the whole thing at once.
To enable hardware acceleration of the image, you have to do something like the following:
/**Creates a blank BufferedImage.
* @param width the width of the Image
* @param height the height of the Image
* @param shouldTransparencyBeAllowed whether to allow transparency in the BufferedImage
* created. In most implementations of Java, allowing transparency is slower.
* @return the BufferedImage created
*/
public static BufferedImage createImage(final int width, final int height,
final boolean shouldTransparencyBeAllowed)
{
//get the GraphicsConfiguration
GraphicsConfiguration graphicsConfiguration = GraphicsEnvironment.
getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();
//this enables/disables transparency and makes the Image more likely to be managed
return graphicsConfiguration.createCompatibleImage(width, height,
shouldTransparencyBeAllowed ? Transparency.BITMASK : Transparency.OPAQUE);
} //end createImage
BITMASK transparency allows a pixel to be either transparent or opaque with no alpha channel blending. OPAQUE transparency is for an image that has no transparency, and I believe this is what you want for the BufferedImage that everything gets drawn to.
That createCompatibleImage method is one of the only ways to get an image that will be hardware accelerated. It’s annoying that images aren’t hardware accelerated by default.
I don’t know how long setRgb calls take, but you may want to use the other getRgb and setRgb methods to modify the whole pixel array at one time if you’re changing every pixel in the BufferedImage using setRgb calls.
If there’s only a small number of particle effects, you might want to precompute them.
There’s a list of flags for the Java Virtual Machine, and it’s possible that one of them may apply. By shutting off Direct3D, I got a huge performance boost for one 2d game I made.