Sign in to follow this  
BeanDog

Character physics in platformer

Recommended Posts

I'm putting together a physics-based platformer using Box2D. I'm wondering if anyone has some suggestions on how to represent characters/baddies in the physics world. I (very) briefly considered actually building a biped from physics primitives and programming walking animations, but quickly realized this would be unworkably difficult. Perhaps a rough bounding box with most of its weight at the bottom (to prevent tipping) and a high friction coefficient? Does anyone have experience doing something like this, that has some recommendations? Thanks,

Share this post


Link to post
Share on other sites
Typically you wouldn't represent characters as physical models like that at all. Ideally you should use simplified physics for the characters by using a bounding sphere/box/ellipsoid for collision and gravity and simple friction that causes them to slide in too steep hills. The bounding volume should always maintain its orientation.

If you can get contact information from the collision detection easily, without running the characters as a part of the physics sim, I suggest that you do the above yourself separately for the characters. When a character dies, you can substitute it with a ragdoll model for fun.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this