Physics engine for 2D games

Greetings,

This is my first post, so first I like to say hello to everyone :slight_smile:

I have never done any game programming before, I have worked with java for a few years thou. Anyways, me and a few friends are working on a small 2D RPG, much like the old game called Flashback but with more side quests and character development. A platform game with RPG elements may sound strange, but I think we have a few good ideas for making a fun and interesting game. Well, thats some background about me and the project I’m working on. The reason I post here is because I cant find any physics engine for 2D, like ODE and Havoc for 3D games. Maybe thats because there is no such engines, but if there is, can someone tell me where I can find one?

Also interested in all kinds of tutorials and guides, any link is welcome. As I said, Im new to game programming and my math really need to be updated a bit :-/

Best regards,
Jenny

ps. sorry for any misspellings, my english is not that good

There are 2D physic engines, but I don’t know one for Java.

However, from reading the description I would say that you won’t need one. (And well even if you get one it might be somewhat painfull to use it)

The stuff you usually need in a platformer is really simple stuff like gravity (x_velocity-=time_fraction*gforce) and some interaction with entities (standing on the ground, pushing crates etc).

http://grexengine.com/sections/externalgames/

articles->java2d->space invaders 101 and 102

Hiya!

Thanks for the link oNyx.

Yes, interaction with game objects is exactly what I was looking for. Not just between the player and objects, but also objects with other objects. I have already made tests, some of them worked ok but collision between objects and how to make objects behave like they should is too complex for me (example, players throws an object on a few crates that are stacked on each other, how they would react on the collision and fall down in a natural way). Thats why I was looking for an already made physics engine, so I dont have to worry about all this complex math :wink:

This is too hard for me, Im going to take a break from all these physics formulas and help with building the game editor. We are going to have a brainstorm how to implement our own script-language and parser, need to be able to script functions events. I think we need to stop having all these brainstorm meetings and acctually start to make the make, or we will never be able to finnish anything ::slight_smile:

I’d suggest using a scripting language that already exists for Java. Groovy, Judoscript, Jython, JRuby, etc.
http://groovy.codehaus.org/

http://www.judoscript.com/

Also check into JSR 223. It is a generic interface for supporting scripting languages in Java. A reference implementation was recently released.

I’m just looking at the above, so I haven’t integrated it into my work yet, but it looks promising.

Hm… I see…

Well, that’s somewhat complicated then and since you’ll need lot’s of rotations it might be a good idea to use one of the opengl bindings (doing that in Java2d will produce a quite huge performance hit right now).

“rigid body dynamics” is the thing you should google for (with quotes). You can find alot of 2D examples (written in Java). Eventually you can recycle some of those examples, but you won’t find a ready-to-use physic engine.

you don’t have to vary your z axis. if you hold the z constant are you not effectively constraining the 3d physics engine two 2 dimensions?