Page 1 of 1

Pick by comparison

PostPosted: Fri Apr 20, 2012 5:50 pm
by ranma
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!

Re: Pick by comparison

PostPosted: Fri Apr 20, 2012 6:48 pm
by R0J0hound
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