It's easy to make hills both in C++ and in Ruby, but I don't use Chipmunk, so I don't know how is it in there.
I can explain it, using some code from Cptn, Ruby (one of Gosu examples)
Here's how it looks without hills:
if move_x > 0
move_x.times do
if would_fit(1, 0)
@x += 1
end
end
end
And with hills:
if move_x > 0
move_x.times do
if would_fit(1, -2)
@x += 1
end
2.times do
if !would_fit(1, 0)
@y -= 1
else
break
end
end
end
end
Basically, when you move your character horizontally, you check if there's no wall on the side. But if you want to take care of hills, you can't check walls at the bottom of the character, but let it overlap. Then if bottom of sprite overlaps some ground, just move the character up. Of course you need to do this per each pixel, so if character moves 1 pixel right, it has to check ground before moving next pixel. You can also make character "stick" to downhills similar way.