How do I detect an object in a random area?

Get help using Construct 2

Post » Thu Apr 14, 2016 9:32 pm

Hi C2 community!

I'm trying to find a way to detect an object within an random internal area comprised between a central object and a line composed by dashes generated by the touch of the player around this central object.

I did this illustration below for you guys better understand the situation. If at least one of these objects stay in this random internal area, the player loses.

Image

I tried to make it through the Line of Sight behavior, calculating the area composed of each stroke object that makes up the broken touch and the central object, but didn't get success. I also tried two methods sugested by our comrade @R0J0hound, but didn't get success too. :(

I thank you in advance your attention and collaboration. ^^
B
38
S
9
G
3
Posts: 258
Reputation: 4,324

Post » Thu Apr 14, 2016 10:55 pm

Place a circle sprite and scale it to the size of the dotted line.

then do a check

If redbox is overlapping circle area
AND redbox is NOT overlapping inner blue circle -> Loss
B
87
S
44
G
16
Posts: 1,002
Reputation: 17,932

Post » Thu Apr 14, 2016 11:52 pm

Afraid the dotted circle was a lazy representation of the facts, i read that the user draws the dotted line. Can be a circle, can be anything, if users are allowed to draw its usaly a ....
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: rayolf and 28 guests