How do I add segment to the rope (physics)

Get help using Construct 2

Post » Tue Feb 24, 2015 3:51 pm

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.
You do not have the required permissions to view the files attached to this post.
Member of PLUS(S). Check out our games at: http://pluss.newgrounds.com/
B
8
S
1
G
1
Posts: 23
Reputation: 838

Post » Wed Feb 25, 2015 11:19 pm

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.
You do not have the required permissions to view the files attached to this post.
Member of PLUS(S). Check out our games at: http://pluss.newgrounds.com/
B
8
S
1
G
1
Posts: 23
Reputation: 838

Post » Thu Feb 26, 2015 1:01 am

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.

flexibleLengthLine_4proto.capx
i know i made 1 image point wrong leave it as it is :) if u change it the game will do the spikes again.
You do not have the required permissions to view the files attached to this post.
B
78
S
23
G
69
Posts: 1,353
Reputation: 43,985

Post » Thu Feb 26, 2015 10:57 am

try this capx
You do not have the required permissions to view the files attached to this post.
B
252
S
39
G
15
Posts: 1,965
Reputation: 40,785


Return to How do I....?

Who is online

Users browsing this forum: dand, mageekm, oosyrag and 20 guests