Page 1 of 1

[solved] How do I chain the player to the ground?

PostPosted: Sat Dec 06, 2014 3:09 pm
by MadameBerry
For a part of my game, my player is held captive by chains until he breaks out. I need to be able to root the player to the ground.
Right now, I followed the Pin Chain Style example in the Examples folder that comes with Construct, and the chain itself attaches correctly to the player, but will not stay rooted to the ground. How can I keep the chain held to the ground without moving?

Thank you!

Re: How do I chain the player to the ground?

PostPosted: Sat Dec 06, 2014 4:34 pm
by newt
Well it depends on the way you are moving things, but clamp(min, max) would be a start.

Re: How do I chain the player to the ground?

PostPosted: Sat Dec 06, 2014 6:37 pm
by MadameBerry
The player is moved using the Platform behavior.
I'll give that a try, though I'm not sure the best way to implement it.

Re: How do I chain the player to the ground?

PostPosted: Sat Dec 06, 2014 7:02 pm
by newt
You could try distance(player.x,player.y, yourchainanchor.x,yourchainanchor.y)> thelengthofthechain, set vector x=0 set vector y=0

Re: How do I chain the player to the ground?

PostPosted: Sat Dec 06, 2014 8:19 pm
by MadameBerry
That seems to work. Thanks!

I handled the appearance of the chains with physics objects and joints. They're super bouncy but that's the best I got.