Determine which object is the second tallest?

Get help using Construct 2

Post » Thu Jul 03, 2014 2:01 pm

Hi, I have a problem I can't find a good solution for.

I have 4 identical objects scaling both in height and witdth at the exact same pace, but they were created at different times resulting in a difference in height. For this example I want the tallest object to be green, the "second" tallest to be red, and the 2 others to be orange.

Any ideas to practically get this to work? Thanks.
B
31
S
10
Posts: 365
Reputation: 3,121

Post » Thu Jul 03, 2014 2:24 pm

For Each (ordered) with expression: Sprite.Height, descending
ImageImageImage
B
71
S
21
G
229
Posts: 3,686
Reputation: 128,336

Post » Thu Jul 03, 2014 2:34 pm

System > For each(ordered) >

Object: Box
Expression: Box.height
Order: descending

---> System > Compare 2 values> loopindex = 0 > box set color green
loopindex = 0 > box set color red
else > box set color orange
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Thu Jul 03, 2014 3:50 pm

Thanks!
B
31
S
10
Posts: 365
Reputation: 3,121


Return to How do I....?

Who is online

Users browsing this forum: fearfulelephants and 26 guests