How do I detect if an object is in an area ?

Get help using Construct 2

Post » Wed Oct 29, 2014 11:22 am

Hello there,

Actually I have two question inside one. First is : Is it possible to create a theoretic area (in any shape) with variables ? for example x1 y1, x2 y2, x3 y3 etc.
It is not the same way to use an overlapping because it is not an object. (Exactly the same usage of the <map> / <area> tag in html)

Then, I'd like to know if there is a way to know when an object (in a way, the x and the y of the object) is inside this area.

Thank you so much !
B
15
S
4
Posts: 57
Reputation: 1,792

Post » Thu Oct 30, 2014 12:26 am

What exactly you want to achieve?
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Thu Oct 30, 2014 8:33 pm

I would PIN as many (invisible) objects as areas you want to detect collision.

To know if it is REALLY inside an area, you must do the math with x,y position (to detect distance between them, center) and width/2 height/2 (as the x,y is at the center of the object)
B
33
S
5
G
1
Posts: 163
Reputation: 2,693


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 36 guests