New upload using acceletated graphics:
http://rel.phatcode.net/junk.php?id=137About 600+ frames per second and CPU usage is about 2% or below.
Also, have you played a game called Touhou before?
Just curious.

Nope, but I saw some really cool videos of it on youtube.
I'm one of the handful of guys who like shmups.
http://www.youtube.com/watch?v=zFoulf_aixo BTW, updated the upload. Should be 2x faster now as I've found a way to force accelerated sprites from this site:
http://www.cokeandcode.com/index.html?page=tutorialssomehow changing this code:
1 2 3 4 5 6 7 8 9 10 11 12
| for( int i = 0; i < numImages; i++ ) { int j = i * 4; int x = texcoords[j]; int y = texcoords[j+1]; int w = texcoords[j+2]; int h = texcoords[j+3]; sprites[i] = image.getSubimage( x, y, w, h ); } |
to this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration(); for( int i = 0; i < numImages; i++ ) { int j = i * 4; int x = texcoords[j]; int y = texcoords[j+1]; int w = texcoords[j+2]; int h = texcoords[j+3]; BufferedImage im = image.getSubimage( x, y, w, h ); sprites[i] = gc.createCompatibleImage( im.getWidth(),im.getHeight(),Transparency.BITMASK ); sprites[i].getGraphics().drawImage( im,0,0,null ); } |
Gave me about 2x performance boost on my dual-core 1.7 ghz laptop and 4x performance boost on my 1 ghz netbook (both with intel GFX). :*)
Try to test it again and see if the FPS gets higher. It should cap at about 900 because of the sleep(1).