Line collision

For questions about using Classic.

Post » Mon Sep 28, 2009 10:42 am

How can I detect collisions between 2 line objects?
B
53
S
14
G
10
Posts: 282
Reputation: 7,578

Post » Mon Sep 28, 2009 10:49 pm

Its not supported.
How ever you can use a sprite as a dummy, and set the sprites to the start and end positions of the lines.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Tue Sep 29, 2009 5:11 am

I was afraid that this is only option.
Thanks.

--- edit ---
Is there any way to retrieve line objcet angle in event sheet editor?
B
53
S
14
G
10
Posts: 282
Reputation: 7,578

Post » Tue Sep 29, 2009 6:11 am

There's no specific command for it, but it's doable with a bit of math.
I'd figure it out for you but all I remember from college is how to drink and smoke.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Tue Sep 29, 2009 6:46 am

You can use the angle() expression to get the angle between the start point and end point, which will give you the angle of the line:

Angle(Line.StartX, Line.StartY, Line.EndX, Line.EndY)

There should probably be an included expression, though.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Sep 29, 2009 8:52 pm

Well there ya go. That's actually a lot easier than I thought it would be. :P
Guess I should pay more attention to the system expressions.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests