Spead values

For questions about using Classic.

Post » Sat Feb 28, 2009 9:39 pm

IS there a way to use spread values?
I'm to to make fan the blows you up. It only works for one, if I add another fan, it doesn't work? So, I'm trying to set up IDs.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Sat Feb 28, 2009 9:58 pm

Do you have the cap so we can take a look at it im not sure you need to set up Ids for the objects.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Sat Feb 28, 2009 10:42 pm

B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Sun Mar 01, 2009 12:20 am

I don't know what spread value does, but I do know how to fix the problem. You need a "For Each" loop, which will loop through each instance of the specified object. This is found in the System object. Basically, just put a for each particlefan condition into the event where the fan blows you up(it needs to be at the top of the event), and then take out the ID checking condition since it's not needed. Hope that helps. :)
Moderator
B
99
S
37
G
19
Posts: 1,584
Reputation: 17,842

Post » Sun Mar 01, 2009 2:33 pm

Unique IDs are better instead of spread values. There is no reason to ever use spread values in Construct, it's a nasty hack designed to emulate other features Construct has. There's always a better way, which is why it's not implemented. However if for some other reason you need to index instances upwards from 1, perhaps to display to the user an object number, you can use a For-Each loop.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests