Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am a huge novice and this isn't really a programming question, but here I go, say I want to make a game that involves rolling up a ramp like this one:

to move upwards, similar to how it would work in an old Sonic the Hedgehog game or something, how would I go about doing that, where could I find a good recourse to learn this?

share|improve this question
    
What have you tried so far? –  ashes999 Nov 5 '12 at 1:19
    
You have to define the curve mathematically, to calculate how to translate the distance on a curve of the ramp to change of x,y coordinates. The distance will be calculated from velocity, the velocity from previous velocity and two accelerations, being player's input (keys pressed) and gravity. –  Markus von Broady Nov 5 '12 at 7:36
add comment

2 Answers

first off not to descurage you or anything, but collison detection and response is quite math intensive, but luckily there are some good resourses and frameworks that can help out with this. if you are just looking for a quick fix a toolkit or library is your best bet, otherwise if you want to write it from scratch it is quite complex, but there are some good resources out there.

the Colision detection toolkit is a good one: http://code.google.com/p/collisiondetectionkit/

anther good framework is box2D, but it is a bit more involved, because it requires everything to be set up in a very specific way, but the advantage is, there is a lot of good documentation and less math involved. : "http://box2dflash.sourceforge.net/" (I can only post two links because I'm somewhat new to the site, so I had to quote the URL... sorry)

if you would like to learn about the way collision detection works here is a pretty good tutorial on the subject: http://www.metanetsoftware.com/technique/tutorialA.html

the basic idea in making a ramp like this work in a game, is you need to figure out if your two objects are intersecting... if so you need to determine the amount they are intersecting and find a the vector orthogonal(aka perpendicular) to the surface of the ramp, to push your player or object out of, so it does not intersect... this process is checked every frame or so to make sure the object does not go inside the other object.

share|improve this answer
add comment

Here is a good resource for sonic-like tile collisions/interactions http://info.sonicretro.org/SPG:Solid_Tiles

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.