This project has moved and is read-only. For the latest updates, please go here.

Interesting idea: moving platforms in top-down game

Jul 12, 2011 at 1:48 PM

For my top-down car game, I'm thinking of having moving / rotating platforms in the levels. Platforms where the cars can drive onto and be moved with them.

The difficulty lies with not killing the vehicle's own velocity. So just taking over the velocity of the platform where the car (or a single wheel) happens to be on, isn't a complete solution. On the other hand, you'd want the car to drive around on a platform exactly the same as how it drives on solid ground. Because there is physically no difference.

I'm wondering what the best solution would be for this situation. Any ideas?

Jul 12, 2011 at 11:47 PM

If it was me I'd try using a Controller to modify the velocity, add the platforms velocity to the wheels. Definitely keep the velocity's separate for each wheel as that will add a great deal of realism. I would be really interested in checking out a prototype when you get it working.

Jul 13, 2011 at 4:27 PM

That was my thinking as well. I see two challenges with this approach:

1. You can't keep adding velocity, so you have to keep track of which body has added platform velocity and which not.  Then every frame you would have to subtract the previous platform velocity and add the current (platforms may rotate or switch direction). You'll also have to subtract it again when the body leaves the platform. This is all doable, it just needs a gentle structure.

2. You'd want to create some sort of friction / slip, as moving a body on a speedy platform won't have him take over the platform's speed immediately. I made a wheel that applies some sort of top-down friction, but that will get a lot more complex now that it will have to take the velocity of it's surface into account.