[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] ODE 2D stuff



On Thu, 2006-01-05 at 22:30 +0800, Simon Wittber wrote:
> I want to use ODE for a 2D platformer. I've read that the way to do
> this is sandwich the game level between two planes.
> 
> My question is, what goes between the two planes? Is it a box, flush
> with the two planes, a box smaller than the two planes, or spheres?

ODE works in a 3D environment. Because of the way it works, things will
tend to fall forward and backwards in your third dimension (probably Z
for a 2D scroller).

This sandwiching means you place two gigantic (or infinite if
supported?) planes that rest on the XY axis. You position one at say
-0.5 and the other at 0.5. All your game objects are then created at the
Z origin (0.0) and are sized 1.0 unit in Z. You may prefer something
like 0.95 sized, just give the simulator some rounding room.

Also be sure to set your sandwich wall objects as Rigid or Fixed
(whatever the ODE terminology is). You don't want your game objects to
start pushing them around as they bounce.