Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Game Programming in Java

I know this is a somewhat common subject, but the information is outdated quickly. I want to stay with the times on the topic...

Anyway, I am looking into creating a 2D game in Java that is able to work cross-platform. As many others have said on Stack, much of the example code and information about Java graphics APIs is outdated to no end.

Here's the deal:

  • Rolling my own is not a problem, but if there is a decent third-party API available I would like to look into it.
  • Which Java API do I use for Graphics / Sound?
  • I am very versed in Swing already, but from my experience it is not the best way to go for a game. I could be proven wrong on that.
like image 475
Andy Avatar asked Aug 13 '11 17:08

Andy


2 Answers

Two of the more interesting game libraries for making 2D games in Java are the Golden T Game Engine and the Lightweight Java Game Library (LWJGL).

I would recommend taking a look at LWJGL first, as there have been several examples of rather successful cross-platform games that were made with it, including most, if not all, of the games released by PuppyGame Studios.

like image 93
Andrey Butov Avatar answered Oct 02 '22 01:10

Andrey Butov


For graphics, you might consider Qt Jambi. It gives Qt-like API to Java, including graphics view(arbitrary 2D drawing, high level API) and its OpenGL classes (OpenGL bindings to Qt, nothing special here). It also contains Phonon, multimedia architecture that can be used to play audio and video.

The minus is that it is just bindings to Qt, so it requires native libraries in order to work.

(Yes sorry I’m part of that project)

like image 43
Smar Avatar answered Oct 02 '22 01:10

Smar