Highest Number between 2 or more Objects....

Get help using Construct 2

Post » Thu Jan 09, 2014 9:45 pm

Probably a noob question, but I'll ask anyway.

How do i check a variable between multiple objects, looking for the highest value?

eg.........

     3 Boxes (sprite)
        "Capacity" (Instance Variable)

   I want to compare "Capacity" for each box, and get the Highest value.


I was using "For Each" but it just keeps giving me the value of the First Box, ignoring subsequent boxes.

Thanks in advance!
B
12
S
2
Posts: 75
Reputation: 2,126

Post » Thu Jan 09, 2014 10:01 pm

Try putting the sprites into a family then use the "Pick highest/lowest" condition.
B
25
S
6
G
3
Posts: 197
Reputation: 3,355

Post » Thu Jan 09, 2014 10:16 pm

@TwinTails

That's a good idea, except it's just one object that I cloned to make 3. Less object, less resources used (my theory). But i'll try it out either way.

Thanks!
B
12
S
2
Posts: 75
Reputation: 2,126

Post » Thu Jan 09, 2014 11:02 pm

@TwinTails

It worked just like you said! Thanks for your help.
B
12
S
2
Posts: 75
Reputation: 2,126

Post » Fri Jan 10, 2014 11:15 am

@dooley No problem, glad you got it sorted

Btw, if it's only one object then you can just use the "Pick highest/lowest" condition for that object.
B
25
S
6
G
3
Posts: 197
Reputation: 3,355


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Buddhika, R0J0hound and 15 guests