Distance between 2 sprites/objects

For questions about using Classic.

Post » Wed Oct 06, 2010 5:03 pm

Is there an event which can be used to trigger an action if 2 sprites/objects are within a certain distance of each other?
B
5
S
1
G
3
Posts: 59
Reputation: 993

Post » Wed Oct 06, 2010 5:14 pm

The condition "is overlapping at offset" dose that.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Wed Oct 06, 2010 5:49 pm

[quote="pooiyx":2qq0z7c2]Is there an event which can be used to trigger an action if 2 sprites/objects are within a certain distance of each other?[/quote:2qq0z7c2][quote="toralord":2qq0z7c2]The condition "is overlapping at offset" dose that.[/quote:2qq0z7c2]

I do believe pointing to the distance expression is more appropriate here.

distance(obj1.X,obj1.Y,obj2.X,obj2.Y)

will return the distance between obj1 and obj2.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests