Are objects inside player's drawn loop?

Get help using Construct 2

Post » 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
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459

Post » 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)
-- Add 1 to birdcount

Sorry I can't help now :(
B
38
S
16
G
17
Posts: 2,230
Reputation: 17,220

Post » 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
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,459


Return to How do I....?

Who is online

Users browsing this forum: mekonbekon, RetroSpock, SnipG, Yozzik and 12 guests