# Are objects inside player's drawn loop?

Get help using Construct 2

### » Wed Jul 17, 2013 5:55 pm

Let's say I got 100 birds on screen. The player must draw a line to cover x number of birds and close the line to form a loop. The loop does not have to be a circle but no part of the line shall intersect itself. It could be shaped anything, BUT the line must be closed.

Now, my actual problem is this: with this closed loop that can be shaped anything, how can I count how many birds are actually inside the loop? The birds' positions scatter randomly and they move around.
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

### » Wed Jul 17, 2013 6:13 pm

Hmmm , Very interesting question ...

It's feasible tho , but with the canvas plugin

You would draw a path and fill it with black

And in a loop :

For each Bird
If rgbat(Bird.X,Bird.Y) = (0,0,0)

Sorry I can't help now :(
B
44
S
18
G
17
Posts: 2,249
Reputation: 17,585

### » Thu Jul 18, 2013 3:37 am

Aha, do you know the performance of that?
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469