"Chains" between objects

For questions about using Classic.

Post » Thu Aug 26, 2010 9:53 pm

Hey guys. Would anyone here be able to teach me a thing or two about putting "chains" inbetween 2 separate objects?

Here's an example I whipped up..but it kinda sucks.



At the top, the 2 objects are idle and the chain links are stacked inbetween them. At the bottom, the 2 objects have separated and you can see the chain links inbetween them.

I've seen tons of games do this, but I've never found any examples on how it's done. I'll try to find a video to further demonstrate what I'm going for. Thanks for any help!

EDIT: Ok found a video showing this off perfectly. Make sure to skip to 2:45

http://www.youtube.com/watch?v=HOUlDt-IH0Q

You can see the "chain links" (those spikey balls in this case) that connect the boss to the background wall. How do they do that?! Thanks.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Thu Aug 26, 2010 10:59 pm

There's no good way to do this as of right now, but it can be done via the "family hack", or with python's picking ability for sprite{index}.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu Aug 26, 2010 11:17 pm

http://www.mediafire.com/?9bq7z78x1d902kc

I would say this is a good way to do it for now. You can add more links in the chain simply by adding more image points.

Hope that helps :)
B
2
S
2
G
4
Posts: 156
Reputation: 1,762

Post » Thu Aug 26, 2010 11:38 pm

6Fix beat me to it. :P

Still here is my example anyway, since it's slightly different using PVs to place instances of the same sprite on the appropriate image points.

[url:3nattqqy]http://dl.dropbox.com/u/2306601/chain_thing.cap[/url:3nattqqy]
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Thu Aug 26, 2010 11:42 pm

My only question, why is newt such a downer!? :P Just kidding.

And yeah I did separate images in case you want a color slant or something.
B
2
S
2
G
4
Posts: 156
Reputation: 1,762

Post » Fri Aug 27, 2010 12:25 am

Nice examples. Pretty cool how easily things can be done in Construct. :)

I had to have a go at this, and I thought of the lerp() system expression. This would be useful if you need the number of links to change at runtime, too.

The first 'link' always is centered behind the 'head' in this example, and the rest are spaced in between it and the 'anchor'. This could be changed easily, though, by using 1/(Link.Count+1)*LoopIndex, or changing the 1 to 0.9, or something similar.

[url:59hxsl5m]http://dl.dropbox.com/u/5868916/ChainExample.cap[/url:59hxsl5m]

Just make sure there is at least one 'link', or bad things may happen, unless a check for that were added.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Fri Aug 27, 2010 12:26 am

These examples are great. Thanks a lot!
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Fri Aug 27, 2010 5:29 am

Quazi made one for me as an example using physics and sprite distortion. I can post it up here when I get on my other computer later if you are interested.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests