JGame - a Java game engine for 2D games

What is JGame?

JGame is an open source 2D game engine that runs on any Java 1.2+ JRE platform (with optional OpenGL enhancements through JOGL), as well as the mobile J2ME (CLDC1.1/MIDP2.0) platform. It provides a very high-level framework for developing "classic" type arcade games. It is based on sprites with automatic animation and collision detection, a tile-based background with easy sprite-tile interaction facilities, and high-level game state and game sequence facilities. JGame games can be run in a variety of ways without requiring any changes in the code: regular applications, webstart, applets, or MIDlets. Graphics are scaled automatically to fit any screen size, from the smallest mobile device to full-screen desktop PC. JGame uses 2D graphics acceleration where available, but using OpenGL enables better graphical quality.

Download / Run

Documentation

View the docs online:

Contact

For problems or bugs, mail me at schooten@cs.utwente.nl
or check out the forums hosted at SourceForge.net Logo

How to get Java

Macos X comes with Java 1.4+ onboard. For Unix or Windows, we advise you to download Java 1.4.2, 1.5.0 (aka 5.0), or 1.6.0 (aka 6.0), whichever newest version is available. If you want to compile stuff, get the SDK (software development kit). If you only want to run games, get the JRE (java runtime environment). The software will install the Java programming language and a Java plugin for your browser.

Example code

So, what does the code of a JGame game look like?

News / Blog

11 mar 2009     After a long break I'm working again towards a new release. In the meantime I've created a couple of new games, and have a couple of bugfixes/minor features.
17 mar 2008     Release 3.3 patch a: Several people pointed out that there were a couple of missing files. I've also disabled use of NPOT because it causes software fallback on some machines.
10 mar 2008     ----- Release 3.3 -----
3 mar 2008    
I'm nearly finished with the new version, which sports multilayer parallax scrolling and view zoom/rotate, and works fully without NPOT extension. In order to make the release look a little more exciting, I'm working on a new game that makes good use of the OpenGL extensions.
26 feb 2008     The biggest problem of the new JOGL version seems to be the dependence on non power of two textures for scrolling, which a lot of machines still do not support. I just modified the code so it no longer requires the NPOT extension. I have also devised an efficient way to do parallax scrolling, which I want to implement before the next release.
16 feb 2008     ----- Release 3.2 -----
13 feb 2008    
Coming soon: OpenGL

The JOGL platform is as good as finished. I am currently wrapping up the new JGame release. Watch a demo of the new OpenGL features here!

29 jan 2008     After a quiet period, I'm back at the project trying to add a third platform: opengl (jogl). I've got a prototype running, but I've still got significant straightening out to do. You will be able to link a JGame app to both the regular JRE verion or the JOGL version. The JOGL version will include: double buffered screen synced animation, colour and alpha blending, arbitrary sprite scaling/rotation, and hopefully parallax scrolling.
9 aug 2007     Here is the 3.0 release at last! It has full support for mobiles, and four of the games were specifically adapted to run nicely on mobiles. There have been major structural changes to the project (and the zip is more than twice as large now).
30 jul 2007    
Coming soon: JGame mobile

Wonder what kept me? I've been busy redesigning JGame so that JGame games can be run on (MIDP) mobiles directly without requiring any changes in the code. Tonight (at 3am, couldn't help myself!) I've finally got a preliminary version running, and it runs pretty smoothly!

Try the pre-release mobile game PubMan. JAR, JAD.

Left: Chain Reaction on my mobile. Click to enlarge.

23 jun 2007     I did a little redesign of the homepage, so it uses space more efficiently and should be easier to use. I hope you like it!
31 may 2007     It appears someone has made a variant of my Chain Reaction game called Invasion!
31 may 2007     I'm trying to run JGame using Webstart, and it almost works, except that the engine reports an exception on the game window when trying to read the user.home property! I'll fix the problem soon. You also get a title bar saying "Java application window". For now, the webstart is signed to obtain the required permissions and get rid of the title bar.
29 may 2007     I've been extending the software with new games, improved games, a highscore table, etc. for release soon. I also found that JGame doesn't perform as optimally under Windows as it does under Unix. I found that using volatile images for the background and buffer makes all the difference. I'm now adapting the code to work with volatile images.
18 may 2007     I found that version 2.1 had a couple of serious bugs. One was that the Jars didn't work in Windows! So, here's a fixed version.
30 apr 2007     Version 2.0 features scrolling, and a number of changes and extensions that naturally come with it. It is very efficient and should be easy to use.
30 mar 2007     Here's the 1.3 release at last! Besides sound, it also includes a web-based game creator.
7 mar 2007     After some busy months I'm almost ready to release the next version. I'm working on sound, but am running into various platform-specific behaviour. There will also be a new game.
7 dec 2006     The columnist Jeff Friesen has written a JGame tutorial on JavaWorld! This also includes a new game which you can download on the link below the article. He also found a bug which I'll fix asap. I've been abroad so I've had no time to work on JGame but I just got back this week and am ready to continue development.
6 oct 2006     JGame has finally been tested on MacOS X and was found to work very smoothly (at least on a Ghz machine it did :-) )
28 sep 2006     The 1.0 release is here. In 1.0, I cleaned up most of the remaining loose ends in the software package. Some bugs were fixed, error reporting is much improved, and there are some interesting new debugging features.
Left: debugging fun. Caverns of Fire under development showing dbgPrint messages, exceptions, bounding boxes, and game state.

Click to enlarge.

26 sep 2006     JGame was featured as "applet of the week" on the Java Posse newscast! (you can find the feature 16 minutes into the podcast)
24 sep 2006     After a productive two-week vacation, the JGame package nearly doubled in size! I spent this sunday wrapping up the package for the 0.9 release. It includes 5 new games, a standard game state machine, standard game objects, and a host of minor changes to the base classes.
8 sep 2006     JGame 0.8 was featured as "applet of the day" on JavaDesktop community!
7 sep 2006     I started on this project about a year ago, and at last, here is the first release! It is fully documented now, and comes with 3 finished games.

Archive and links

A list of Java games is now maintained on a separate page

Some interesting Java game sites:

Where to get graphics and sounds for your games: Other 2D game engines: