Sign in to follow this  

Suggestions for character feet in 2D platformer

This topic is 4300 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently making a 2D platform using C++ and OpenGL. I use OPAL for physics(it runs ODE, for those of you that aren't familiar with it). I have come to the point of implementing the player into the game. My problem is when the player comes to a hill. The player will be able to walk up a hill of atleast 45 degrees, possibly abit more. I have locked the player to always be straight-up. I am currently using a single 2D sprite for the player. What would you recommend me to do? The possible solutions that I have thought up: Currently, the feet of the player is either sticking halway into the hill, or only the farthest out toe will have contact with the slope, the rest of the player just sitting there. Having the player at a a right angle to the ground at all times would work, but would look really idiotic and be physically impossible on steep slopes. I could create two seperate boxes that can rotate more freely than the player and but are attached to the bottom of the character. I would then use these positions for the feet. I could also break the player into numerous more parts and basically treat it as a ragdoll and apply forces where needed. I'd like to avoid that, as animation could be rather difficult. --------- On a side note, how would you recommend handling the walking animation while going up a slope? Thanks in advanced! Edit: after some more thought, is allowing the player to walk up 45+ degrees a good idea? You never do that in real life, and would have difficulty doing it even if you wanted to. Its very common to do this in a video game, though.

Share this post


Link to post
Share on other sites
It is possible to walk up slopes with gradients of up to about 50°, although only just (and slowly). I know this from doing geological fieldwork and taking my clino to a particularly steep hill!

I would rotate the feet to match the landscape, and if it's a steep hill you may have to bend the knee and hip as well to make the joint angles look realistic. For the walking animation, just adjust the vertical position of the knee and ankle joints at each frame to compensate for the change in ground elevation.

Share this post


Link to post
Share on other sites
So you're suggesting to use multiple body parts put together instead of one sprite? I am currently using just a quad with a texture over it for the person. It would be a good programming exercise to do that, and could have pretty good results. I'll look into it.

And thanks for that interesting tidbit! I'm also geussing that it would be posssible to go up a steep hill very quickly too(ie: with a running start).

Share this post


Link to post
Share on other sites
This sounds like an art problem to me. You don't want to reorient the sprite to be paralell with the ground: that doesn't look right for bipeds. If you are able to determine when the user is going up a hill, I think the best solution would be to have a seperate walk animation: hunched over, hands on knees, etc. I think a decent artist should be able to make that look convincing on almost all the different inclines. And if not, you can always make sure all your inclines are the same. Most 2D platformers are like this.

Matt

Share this post


Link to post
Share on other sites
But I'm not a decent artist... After studying the classics some more(read: Mario), I've decided to take the easy way out and have the same animation with the feet sticking into the ground just a little. It worked for Mario, it'll work for me.

Share this post


Link to post
Share on other sites

This topic is 4300 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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