How do I add segment to the rope (physics)

0 favourites
  • 4 posts
From the Asset Store
Add SubRip (SRT) subtitles to your videos in Construct 3
  • Hey,

    I made a rope which is based on segments (sprites: link) connected by revolute joints. I make a rope of preset length and it's working great. Now I want to add a new segment on top of my rope, so I won't to make it longer by one segment. Just press "+" and see what happens. A new segment is added on top but it looks out of place... It reacts with the rest of the rope, but it has an angle that ruins it... The only resolution for this that almost works is when I change collision polygon of link sprite to very small. This way a new segment aligns quite well with the rest of the rope. Unfortunetly setting it like this breaks the rope physics... Do you know how can I achieve it? Thanks! I need this for the prototype I'm working on.

  • I was still fighting with this and this is what I achieved finaly. It's by no means good, but for prototype it'd be enough. What I used is:

    • changed collisions for boxes and changed their size for smaller, but start and end points of link sprite of rope have to be inside this col box, else rope breaks;
    • I added distance joints to keep rope together even if it'd normaly break;
    • set the sprite size to much longer (now it looks strange, but if sprite would be short then line after adding couple of segments would have big empty spaces between links).

    Maybe someone has a better idea how to do this?

    Before I also tried to spawn rope of fixed size and just move it up hiding it off the screen or down to make illusion it's getting longer. But then other problems arose, because those 'unused' parts of rope still reacted with the rest and rope became hard to control and too unresponsive.

  • not sure if this is what u meant, but i made it a bit smoother , and added 1 extra line to destroy the links when is outside the bottom viewport, so it makes it less weight on ur spring. u did not had angular damping right as long as density. just play with those to make it as u want for now i guess its good, if that is what u looking for, however when u press down the spikes still happen until u stop. also u had some events lined wrong, remember c2 reads from top to bottom, so if u put lets say (on collision with wall, destroy then under u say add points) the add points action wont happen since the actor u destroyed it.

    [attachment=0:1dk5im4m] if u change it the game will do the spikes again.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • try this capx

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)