PDA

View Full Version : Java 2D Sprite based game


unknown
2006.10.31, 06:02 PM
I want to write a small game in java with sprites and so on,
its a been a long time since i've done anything like this with java so I would like to know what the right classes to use are (AWT? swing? Graphics2D?).

the game would have a fully scrolling background with characters on it, so I cant use dirty rects to optimise, apart from that I dont think theres anything that would alter the choice of classes to use..

so, what should I be looking at for 2D sprite based game programming? :D

thanks a lot

kelvin
2006.10.31, 06:24 PM
JOGL (https://jogl.dev.java.net/)?

OneSadCookie
2006.10.31, 06:46 PM
LWJGL (http://lwjgl.org/) :)

Tools10
2006.11.01, 06:21 AM
The order in which you should consider them:
1: OpenGL, if your familiar with it, go for it.
2: awt, it's the easiest and fastest way(Graphics, Graphics2D, Frame, BufferStrategy, Image, BufferedImage).
3: swing, memory consuming and slow compared to awt but should work for a simple game(ImageIcon, JFrame, some other classes).

unknown
2006.11.01, 06:27 AM
Ok well i've started with AWT doing a speed test, and all looks fine and well, except on PC or linux..
Ive had endless problems with BufferStrategy, so can anyone tell me what I need to do to double buffer a java.applet.Applet?

Thanks a lot for all the comments so far.

kelvin
2006.11.01, 06:13 PM
LWJGL (http://lwjgl.org/) :)
I dunno, I couldn't get any of the OpenGL lwjgl demos to display on my MBP.
JOGL demos on the other hand, launch and run flawlessly.

OneSadCookie
2006.11.01, 06:28 PM
Last I checked, LWJGL's binary distribution was PowerPC-only. I grabbed the files from within Titan Attacks (http://puppygames.net/titan-attacks/index.php) and I don't recall having problems.

kelvin
2006.11.01, 09:38 PM
Must be a problem with the JNLP demos. Anyhow, those don't work. Anything downloaded in jar format like the puppytron games seems to work fine.

OneSadCookie
2006.11.01, 10:20 PM
Probably the JNLP demos are shipping PPC-only JNIlibs...

StealthyCoin
2006.11.02, 12:41 AM
Ok well i've started with AWT doing a speed test, and all looks fine and well, except on PC or linux..
Ive had endless problems with BufferStrategy, so can anyone tell me what I need to do to double buffer a java.applet.Applet?

Thanks a lot for all the comments so far.


I emailed you a thing showing how to do that. Its fairly easy.