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
55
S
14
G
10
Posts: 287
Reputation: 7,677

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 ImageImage
B
166
S
49
G
155
Posts: 8,111
Reputation: 100,743

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
55
S
14
G
10
Posts: 287
Reputation: 7,677

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 ImageImage
B
166
S
49
G
155
Posts: 8,111
Reputation: 100,743

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
113
S
41
G
20
Posts: 1,586
Reputation: 19,096

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 ImageImage
B
166
S
49
G
155
Posts: 8,111
Reputation: 100,743


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest