How would I go about drawing arrows between boxes?

Get help using Construct 2

Post » Sun Dec 02, 2012 8:25 am

I am designing a connect-type puzzle game, and the one thing I am having trouble with is coming up with a simple method to connect boxes with a line and arrow - with automatic connections when the boxes are moved.

A bit like this:


The player would have to be able to simply drag connections between boxes by dragging the arrow head on top of another box. And moving a box would automatically re-draw the existing connections, no matter where it is placed. Connecting/disconnecting would fire up an event.

I initially thought about applying the path finder behaviour, but that seems a bit overkill. There must be a simpler way in Construct, though I need some help uncovering it.

Any suggestions?
Win7 64- i7 920@3.6Ghz, p6t Deluxe v1, 48gb, ATI 7970 3gb, EVGA 590 3GB, Revodrive X2 240gb, e-mu 1820. Screens: 2 x Samsung s27a850ds 2560x1440, HP 1920x1200 in portrait mode
B
22
S
4
G
4
Posts: 98
Reputation: 3,955

Post » Sun Dec 02, 2012 1:10 pm

Try this, then you only need to tell it to draw a line from the original Image Point of the arrow to the end of the arrow.

https://dl.dropbox.com/u/108799982/Capx%20Demos/PinBox.capx

Sorry if it's not helpful, but it's past midnight and my brain hurts
Using R238 for all examples
B
60
S
17
G
6
Posts: 363
Reputation: 9,125

Post » Sun Dec 02, 2012 11:09 pm

Here is a setup to do the connections and such:
http://dl.dropbox.com/u/5426011/examples16/nodes.capx

Instead of straight lines you could also try a curve:
http://www.scirra.com/forum/an-always-interconnected-line_topic60289_post370259.html?KW=capx#370259
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Mon Dec 03, 2012 5:11 am

Thank you very much, ROjOHound! Exactly what I'm looking for. Great setup.
Win7 64- i7 920@3.6Ghz, p6t Deluxe v1, 48gb, ATI 7970 3gb, EVGA 590 3GB, Revodrive X2 240gb, e-mu 1820. Screens: 2 x Samsung s27a850ds 2560x1440, HP 1920x1200 in portrait mode
B
22
S
4
G
4
Posts: 98
Reputation: 3,955


Return to How do I....?

Who is online

Users browsing this forum: ETgirl79, Zebbi and 19 guests