Java 2D Sprite based game

Sage
Posts: 1,403
Joined: 2005.07
Post: #1
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? Grin

thanks a lot

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #2
JOGL?

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
Quote this message in a reply
Nibbie
Posts: 3
Joined: 2008.04
Post: #4
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).
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #5
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.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #6
OneSadCookie Wrote:LWJGL Smile
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.

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #7
Last I checked, LWJGL's binary distribution was PowerPC-only. I grabbed the files from within Titan Attacks and I don't recall having problems.
Quote this message in a reply
Member
Posts: 469
Joined: 2002.10
Post: #8
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.

---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #9
Probably the JNLP demos are shipping PPC-only JNIlibs...
Quote this message in a reply
Member
Posts: 67
Joined: 2006.06
Post: #10
unknown Wrote: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.

The machine does not run without the coin.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Game programming resources for Java JeroMiya 3 3,887 Sep 28, 2007 04:06 PM
Last Post: JavaGuru
  How to upload scripts for text based game? Gdollaz87 5 3,949 Aug 1, 2007 10:31 PM
Last Post: Gdollaz87
  Java/C++ Sever-side RPG Text Based.. darkdescendent 1 2,351 Oct 27, 2006 07:47 AM
Last Post: BeyondCloister
  Java game-writing resources? stevejohnson 7 3,637 Sep 4, 2006 09:31 AM
Last Post: Blacktiger
  Java Text Based RPG QuakeMist 3 4,810 Sep 21, 2005 03:12 PM
Last Post: unknown