Box2D Java

jME is a 3D engine, while in theory it can be used to make 2D games, the fact is that it has very little support for them

for 2D games, Slick is a great choice (hardware accelerated using LWJGL)
ewjordan: I was thinking of using JOGL, which is an OpenGL binding for Java.
It would be wonderful to get both Slick and LWJGL demos working, for sure - Processing is great for applets, but when it comes to raw speed an optimized OpenGL framework will always beat it out, and I'd love to see how this performs without the graphics bottlenecks. I don't have the time to look into it all myself right now, but I'm available to help with the JBox2d integration if someone else knows how to set up a basic game loop (frame rate fixing, graphics setup/refresh, drawing methods, camera stuff, and keyboard/mouse handling)...
Hi guys.

About java2D, what problems did you run into? I know it's heaps hard to do 2d geometry: making polygons and changing their coordinates using GeneralPath is unwieldy.

But java2D is the best at rendering - it works everywhere and comes standard in the JRE. You can use the software, openGL, and direct3d pipelines and whatever the jre has as default (software mostly) just works. Also, it works in applets, webstart, etc.

Also, java2D is more accessible for the beginner (most wouldn't be familiar with the Processing demo code).

Thanks,
Keith
I could write a game loop. I'll work on it this weekend.
@COmmanderKeith:
Quote:
About java2D, what problems did you run into?

Honestly, my problems are not with Java2d specifically, though it does have some (it's a bit slow, though it's faster than it used to be, and it doesn't look the same on all graphics cards/OSes thanks to lack of standardization in hardware for things like joins/caps and smoothing on lines) - in fact, the testbed actually does use Java2d behind the scenes. It's kind of a pain that you have to manually cast everything to int before using it, though this is not a huge problem.

In reality, though, I went with Processing because it's what I know, so I could set up I/O, double buffering, game loop, camera transforms and integration with the tests within a half hour or so, whereas it would have taken me a lot longer to get it right using raw Java.

I agree that a realistic sample use (or a few) of the engine would be invaluable. One thing to keep in mind - nobody is really going to be drawing every shape with lines, they will be binding sprites to the shapes. So to some extent the particular drawing API used is not essential, as that stuff will be abstracted somehow anyways.

Quote:
Also, java2D is more accessible for the beginner (most wouldn't be familiar with the Processing demo code).

Agreed. Let me offer the same thing I did earlier re: JOGL/Slick/LWJGL - if someone can provide the skeleton of a game loop, maybe with just a sample drawing of a moving line or a moving/rotating sprite, I can get the JBox2d integration working. I personally prefer applets to apps or webstart, but something that can run as either is a bonus (the current demos do this, but I don't know the specifics of how).
OK cool, fair enough. About those OGL libs, I have no experience sorry. But I don't think involving them is a good idea for the demos - they are infamous for mostly not working (due to ogl driver problems).

Hey by the way ewjordan, I thought you might be interested in this: http://www.javagaming.org/forums/index. ... #msg141856,
a java port of Bullet.
I came to the lab today to slam together a simple Java game loop, but somehow my ID card doesn't work anymore. That means I don't have a machine to work on. (written from library kiosk)

I'll see that a JOGL game loop gets written as soon as I can find a computer where I can do dev work.
Simple jogl game loop: http://kevinchiu.org/box2d/jogl_game_loop.jar

You'll probably need to extract the JAR, import the files into Eclipse, and then add the appropriate binaries and jar files to your build path before it will run. See README inside the jar for details.

(To extract, you may need to add .zip to the file name.)

Once you get it running, you can click to create random moving boxes.
@COmmanderKeith: Yup, I've had my fair share of problems with OpenGL in Java, and basked in the irony - that two techs billed as totally platform independent have not been able to get their collective act together and play nice with each other almost a decade after their creation is simply a shame. Lately things have been a bit better, but I definitely share your distrust.

Having said that, I'm still interested in getting demos using some of the various OpenGL libraries because they are very popular for making Java games, and realistically, a lot of people will probably start from there.

@fyzle: Excellent, got that working in a mere five minutes, runs nicely. I'll see if I can put aside the time to try and get a basic JBox2d scene working with that. Also, since it appears these things are BSD licensed, I may even see about distributing the whole thing as a big .zip with the Eclipse project files already included - I know that with the C++ version, it was immensely helpful to just open up Visual Studio and be running within a minute of downloading.

Original thread: https://box2d.org/forum/viewtopic.php?t=36