Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

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:

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. : "" (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:

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
It does not have to be so complex. Since this is a Flash game and the level of graphics was not mentioned, its physics are not going to be flight simulator-grade, so no advanced collision detection algorithm might be required. Plenty of retro games do very neat animations without using a world-realistic physics engine. – sleblanc Jan 8 at 7:44
And since we are looking at collision with fixed geometry (the ramp) and we are not doing bouncing collisions, there is no need to calculate vectors at all, just checking if the player is still inside the geometry is enough. – sleblanc Jan 8 at 8:01

Here is a good resource for sonic-like tile collisions/interactions

share|improve this answer

Your Answer


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.