Drawing with instances

Get help using Construct 2

Post » Fri Jan 20, 2012 3:31 pm

Hi guys, Instances is a weak spot of mine

I need to draw a lined from each instance to the next. I tried a for each event. But nothing happened.   

Here is my capx: capx

And here is a little image i done showing what im trying to achieve: Image

Thanks.

ps, I know the way I code may look a little weird. Oh and im working on the arcade layout right now, not level 1.
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Fri Jan 20, 2012 4:10 pm

When you tackle this kind of problem you have to list what the system has to know and what it can deduce.
For instance, how the system knows which instance to link which each other instance?
I mean. if you have 4 dots, there's many ways to link them.
In your picture it seems an instance will always be linked to the same two others.

So, how can you tell the system how to link them?

I think you can use an instance variable named 'order' that will hold maybe the order your object were created
so you can create lines from the first to the second, etc etc.Yann2012-01-20 16:11:22
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Fri Jan 20, 2012 4:17 pm

@Yann,

Im not entirely sure how the system should know, like you suggested a instance variable with a order would make allot of sense..

I Basically need to be able to drag all of the instances around the stage, The line will connect all four of them. If the line is over all four targets then level complete.

The user has to be able to position the line between all of the targets to win,

Does that help?
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Fri Jan 20, 2012 5:20 pm

Boy, this was a toughy...

....here's your new CAPXWeishaupt2012-01-20 17:21:08
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Fri Jan 20, 2012 5:29 pm

Thanks!! @Weishaupt. Really saved my day :)
B
29
S
12
G
7
Posts: 740
Reputation: 7,839


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Yahoo [Bot] and 21 guests