# Implementing the sonic loop concept

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

## Recommended Posts

Well, I really want a sonic loop in my game :-) Just to make things clear - I'm talking about the way sonic can run through a loop after gaining enough speed, or fall off it if he isn't fast enough. I can't figure out a good way to approach this problem, and looking for a solution on the internet produced no helpful results. I couldn't find any open-source sonic ports either (funny how there are tens of super-mario ports, probably since it's much easier to create). Any ideas/links? Thanks ahead.

##### Share on other sites
I don't know if you ever noticed, but while you're in one of those loops, the game will not respond to commands (like a jump, or pressing the reverse direction). So it's probably a simple check that Sonic's speed exceeds some threshold, and not some complicated physics involving centrifugal force and gravity. Also, the loops were all the same size, which supports this hypothesis.

If you want to figure that part out, you'd stay on a loop if you could go fast enough that the centrifugal force (really, it's the normal force exerted by the loop) exceeds gravity.

##### Share on other sites
I don't know about the original sonic, but this: http://www.ebaumsworld.com/sonic.html version has it working properly...
In fact, looking at the problem again, the loop itself is just an instance of my bigger problem - interacting with inclined surfaces.
I figured one way to go about is to build the loop (or any other surface) from several straight lines, each affecting the characer with its normal force once they collide. But there's probably a "cleaner" solution to this problem, I don't like the idea of applying a collision detection test to each part of the loop...

##### Share on other sites
In the correct polar coordinates, the surface of a loop is a strait line.

Of course, gravity behaves wierdly, and speed generates force, but at least you have a strait line to run along. :)

##### Share on other sites
Quote:
 Original post by GPXI don't know about the original sonic, but this: http://www.ebaumsworld.com/sonic.html version has it working properly...In fact, looking at the problem again, the loop itself is just an instance of my bigger problem - interacting with inclined surfaces.I figured one way to go about is to build the loop (or any other surface) from several straight lines, each affecting the characer with its normal force once they collide. But there's probably a "cleaner" solution to this problem, I don't like the idea of applying a collision detection test to each part of the loop...

Like the fact that the normal force always points toward the center of the loop (assuming the loop is a circle)?

##### Share on other sites
Quote:
 Original post by NotAYakkIn the correct polar coordinates, the surface of a loop is a strait line.Of course, gravity behaves wierdly, and speed generates force, but at least you have a strait line to run along. :)

That sounds like an interesting idea - playing with the coordinates.
Care to go into more detail?

BTW, sorry for the latency, I have access to my computer only during the weekends :\

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 13
• 19
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
632935
• Total Posts
3009304
• ### Who's Online (See full list)

There are no registered users currently online

×