where two objects overlap

Get help using Construct 2

Post » Mon Sep 02, 2013 9:02 am

Does anyone know of a reliable way to pinpoint the exact coordinates at which two objects overlap?

I know that if the objects are 90 this is pretty easy (you use the vertical one's X, and the horizontal one's Y) however, I have no clue how to do it if the objects are at an angle other than 0 or 90.


This show how it should look.

Also: they wont overlap at their origins.Sargas2013-09-02 09:03:52
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Mon Sep 02, 2013 1:40 pm

Its possible, but it would be an really hard calculation, I try it but I can only calculate 1 single point in the red area ...

But you could tell us for what you need this, with some luck we could find another way.
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Post » Mon Sep 02, 2013 2:33 pm

There is some posts on this in the How do I section
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Mon Sep 02, 2013 5:08 pm

@whiteclaws damn, didn't find any, I should have looked better. Going to
go look now =) (Edit: didn't find any that did this, would you be so kind as to paste a like here

@Darklinki It's for a road system, where objects follow the lines, and know where the intersections are beforehand. The roads are created in real time by the player.Sargas2013-09-02 17:17:08
B
43
S
12
G
6
Posts: 446
Reputation: 6,802

Post » Mon Sep 02, 2013 6:01 pm

ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Mon Sep 02, 2013 6:02 pm

Ninja'd by hornet :p
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,461

Post » Tue Sep 03, 2013 3:38 am

Thanks for the help guys :D. As it turns out, it does what I wanted to do... However, I don't think it's worth the trouble, since in my game it was just for aesthetics, and it requires math that is WAY too complex for my tiny brain =P. Specially since I would have had to modify it to work with a dynamic number of lines.

But, in case someone's feeling generous: My roads are segments of straight lines joining nodes of a pathfinding. You can have as many roads as you want in the game, with intersecting segments all over the place. So the lines intersecting would be of the same instance. Also, once the segments are set, they won't ever move from that place.
B
43
S
12
G
6
Posts: 446
Reputation: 6,802


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, nahima and 14 guests