# Examples of Rope/“Stretch” Physics? (Read 232 times)

Started by Bane84, December 15, 2019, 08:26:10 pm

#### Bane84

##### Examples of Rope/“Stretch” Physics?
#1  December 15, 2019, 08:26:10 pm
• Original characters are my forte.
I’m attempting to code a move where the character fires a grapple gun.  I’m expecting to use some form of a distance vector where point A is the mouth of the gun, point B is the edge of the grappling hook attached to the rope, and using AngleDraw on the rope to properly scale and rotate it (length of the rope as it travels and the trajectory the grappling hook travels).

What I need to figure out is:
• What graphic do I use for the rope sprite?
• What sort of AngleDraw formula should I use?

There has to be an existing character or thread somewhere where this issue has already been solved.  Could someone point me in the right direction?  Thanks.

#### ink

##### Re: Examples of Rope/“Stretch” Physics?
#2  December 15, 2019, 10:48:14 pm
• inktrebuchet
Surprisingly, I don't think I've seen a character use anything like that. at first I thought Pythagorean theorem would be prefect for figuring out the length of the rope but this is a pixel world so ParentDist X or P2Dist X would work.

I think for the AngleDraw formula, something like 'tan((abs(p2dist y) / p2dist x))*(180/Pi)' as a base would solve the angle if it's being set from p1.

I really think a single pixel would look best since any rope pattern would look odd stretching.

Last Edit: December 15, 2019, 10:58:15 pm by ink

#### Cyanide

##### Re: Examples of Rope/“Stretch” Physics?
#3  December 16, 2019, 10:07:08 am
• Legendary XIII
• I am the eye of the storm to come!
I think there is something like this in the code library. Most variants have often used a simpler system where you just have a bunch of circular explods and they position themselves at a specific distance between parent and helper end point. Oillusionista made a boss character with a slightly similar effect once but its not quite what you're after.

In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.