Pick by comparison

Get help using Construct 2

Post » Fri Apr 20, 2012 5:50 pm

The one very important functionality (at least for me) missing that was in construct classic, is "pick by comparison" where you could pick a sprite by comparing its... whatever, say instance variable.

For anyone wondering how to achieve that now (not a very good way to do this, but as far as i know, the only way, so @Ashley goes the question is there any other, more optimal way, or is there a chance to add this functionality) is to create an event like this:

+ pick all Sprite
+ for each Sprite
+ if Sprite instance variable Sth = 1
= do something

cheers!
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Fri Apr 20, 2012 6:48 pm

I would also like to see a "pick by comparison" condition added. For now just use a instance variable.

So the CC event:
+Sprite: pick by comparison distance(Sprite.X, Sprite.Y, MouseX, MouseY) Less Than 100
--- do something

Is done in C2 like so:
+Every tick
--- Sprite: set dist to distance(Sprite.X, Sprite.Y, Mouse.X, Mouse.Y)
+Sprite: dist < 100
--- do something
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755


Return to How do I....?

Who is online

Users browsing this forum: chcteacher, Televangelist and 28 guests