Joined: Sun Jun 26, 2011 10:22 pm Posts: 13 Location: Seattle, WA, USA
|
What exactly do you mean by platformer physics? Platforms would be static rectangles, I believe the player character would be a kinetic object, and you could apply impulses to the player when they're on the ground, in the upward direction (with gravity of course enabled). Also enable fixed rotation on the player so he always points up. You'll need to use of the repo on GitHub to use kinetic objects since it's a new-ish feature in JBox2D.
The only real gotcha to be aware of is...if you have a tile-based world (like...Super Mario Brothers on the NES), you can't have a one-physics-object-per-tile model and just stick all the tiles next to each other to make the platforms. Due to little floating point rounding issues, anything walking along the surface of those platforms will get snagged on the corners, so just...do some post-processing to combine adjacent tiles into a single physics body.
|
|