# Thread: How can I create a curved line made from smaller actives ?

1. ## How can I create a curved line made from smaller actives ?

How can I create a curved line made from smaller actives ?

I want to make something like the following, from one point (x1,y1) to another point (x2,y2)

2. Are you using the physics object?
If so you can use the "Physics - Ground" object to plot a lot of dots to to make the curve.

3. Thank you, but it doesn't really help me.

I know how to make a straight line (from here and here ), but I don't know the formula for a curved one.

4. You should read up on Bézier curves here: http://www.create-games.com/article.asp?id=1866

I would suggest stringing 3 point Bézier curves end to end in order to draw your curve lines (and to make the path your coaster will follow).

5. I still can't figure it

6. Can you say what is confusing you? Bézier curves are something you need to play with for a bit before you grasp the concept.

As for your image in the OP, that looks more like a polygon mesh with a texture. You are probably not going to get as smooth of a curve with individual sprites strung together. Most old game made unique art for the angles used in a curve and then placed them by hand.

Are you needing this for a roller coaster game?

7. Sorry for my late reply. I want something like this:

green - start point
blue - end point
yellow - curve made from smaller actives

I've also found these formulas, but I don't know if they are good for what I want: https://en.wikipedia.org/wiki/Curve_fitting

8. Here is an old example of a 3 point bezier curve. It is based on the article in the link I mentioned above. I actually use this to visualize 3 point curves, since the curve does not pass through the midpoint.

bezier_test.mfa

I am drawing a blank right now on what the formula is to set the angle to follow the curve. Perhaps someone else could chime in with the answer?

9. This should do the trick

Thank you very much

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•