How do I check if an object is within a certain range?

Get help using Construct 2

Post » Sat Oct 17, 2015 4:36 am

How do I check if an object is within say 5 pixels of some specific location?
B
6
S
1
Posts: 33
Reputation: 495

Post » Sat Oct 17, 2015 5:24 am

I got it working, but I don't know if my way is good.

Basically I inverted an absolute value inequality into two inequalities (two for x, two for y).

As I type this I realize I could have just done distance(targetX, targetY, self.X, self.Y) < 5
B
6
S
1
Posts: 33
Reputation: 495


Return to How do I....?

Who is online

Users browsing this forum: Bing [Bot] and 10 guests