Simple conduction logic

Get help using Construct 2

Post » Fri Nov 23, 2012 3:13 pm

Hi, I'm trying to do a simple heat conduction system using a 'Source' & some 'Conductor' sprites. These have a 'hot' instance variable & 2 animation frames for the cool & hot states:



As you can see, the part I'm stuck on is getting conductors to set the hot variable of other touching conductors.

Any ideas? Here's a capx in case anyone wants to fiddle:

https://dl.dropbox.com/u/52354372/conductor_test.capx

Thanks :)mattb2012-11-23 15:14:38
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Sat Nov 24, 2012 12:59 am

Here's two possible solutions:
One using families... conduction1.capx (r110.2)
and the other using an extra hidden sprite to check for overlaps... conduction2.capx (r110.2)
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Sat Nov 24, 2012 10:44 am

Thanks! This is very helpful in learning Construct's subtleties.

Families are the elegant solution (I'm tempted to shell out the 80 quid just to play with them), & the 2nd hidden sprite example is very clever. Since it appears at the end of a chain, provided there's no branching, it could serve some extra visual effect.
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Mon Nov 26, 2012 11:26 pm

Another question - here's the setup so far, using ramones first example:



Now say that the conducting sprites have a 'resistance', & their frame number increases along the connected chain like so:



Could a family picking method like the one used above do this?

I've tried making the (what I'm assuming to be a) triggered loop on event #4 into one that iterates the anim frame as it steps through each sprite. That doesn't work & I'm probably wrong about it looping - it might just be picking all connected family members at once...
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Mon Nov 26, 2012 11:42 pm

This should do it:
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Tue Nov 27, 2012 4:55 pm

Thanks for taking a look. This is similar to where I'm at at the moment- it works for single overlaps but breaks with multiple ones:



I think I might just stick with the simple conduction...
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Tue Nov 27, 2012 6:07 pm

If you make the collision masks beveled like an octagon then conduction will not occur diagonally.
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Tue Nov 27, 2012 6:59 pm

nice idea & it works in more situations than before, but still not right...

B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Tue Nov 27, 2012 11:07 pm

How about this?
conduction5.capx (r110.2)
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Wed Nov 28, 2012 12:20 pm

B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests