Platforming game doesn't feel right

Official forum for the Chipmunk2D Physics Library.
Post Reply
Frog
Posts: 3
Joined: Wed Jul 18, 2012 11:41 am
Contact:

Platforming game doesn't feel right

Post by Frog »

I've been trying to make a platforming game using Chipmunk, but I just can't seem to make it feel right. Currently I only have three objects: two static bodies that make up the ground, and one body that represents the player. All bodies have rectangular shapes attached to them and the inertia of these bodies is calculated using the helper functions.

I've tried all kinds of values for the mass, gravity and forces (ranging from realistic values to crazy ones) and I've also tried applying forces and impulses, and setting the forces manually. But whatever I do, the movement (left, right and jumping) keeps feeling sluggish and not fun. :cry:

So my question basically is: how should I implement movement for a platforming game in Chipmunk? My goal is to have the movement feel similar to for example League of Evil, how can I do that?

Thanks on forehand! :)
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Platforming game doesn't feel right

Post by slembcke »

https://github.com/maximile/Your-Story
http://udevgames.com/entries/your-story

This was a contest game I collaborated on. I implemented the platforming physics, and it's all built on top of Chipmunk. That might be a good place to start.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Frog
Posts: 3
Joined: Wed Jul 18, 2012 11:41 am
Contact:

Re: Platforming game doesn't feel right

Post by Frog »

Thanks for the quick respone! :)

I had actually already taken a quick look at that project, but couldn't really figure out how it worked. But since you also say it's a good example of a platforming game made with Chipmunk, I'll take a detailed look at the code. Let's hope it helps! ;)
jcmeyer5
Posts: 89
Joined: Thu Dec 15, 2011 9:18 am
Contact:

Re: Platforming game doesn't feel right

Post by jcmeyer5 »

For what it's worth, I have a platformer control setup I like. For everything (at the moment) I am using friction of 0.5 and elasticity of 0.5. Those values work very well for me.
Chipmunk Pro and cocos2D 2.x branch for iOS development
Frog
Posts: 3
Joined: Wed Jul 18, 2012 11:41 am
Contact:

Re: Platforming game doesn't feel right

Post by Frog »

Thanks jcmeyer5, that's really usefull information! But how do you move the object? Similar to the Your Story game, or in a different way?
jcmeyer5
Posts: 89
Joined: Thu Dec 15, 2011 9:18 am
Contact:

Re: Platforming game doesn't feel right

Post by jcmeyer5 »

I apply an impulse (when input is received) in the direction I want to move (left,right,jump). I then cap max velocity at a given value. Using impulses let's you not worry about syncing velocity, position, etc. and also gives you a nice ease into your movement. I think I was using impulses of 600... that is a bit high for my tastes... I will probably back it down.
Chipmunk Pro and cocos2D 2.x branch for iOS development
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests