[Solved] How do I check "full overlap"

Just started using Construct 2? Post your questions here

Post » Tue Sep 13, 2016 8:11 am

Another day, another newbie question! :D

How do I check if a sprite "fully overlaps" another?

My goal is to check when a ship exits the "combat area" and in that case destroy it. An housemade way could be to create another sprite, bigger than "combat area" sprite and in a lower z-level, and check when it is overlapped by the ship... but I don't like it too much.

Any idea?
Last edited by JeffSkyrunner on Thu Sep 15, 2016 11:13 am, edited 1 time in total.
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Wed Sep 14, 2016 3:16 am

I remember seeing this once (on the [How do I] FAQ thread, btw).. I think I even tried it.. If it doesn't help, let us know and I'll try harder :)

viewtopic.php?t=72677&start=0
B
88
S
43
G
71
Posts: 601
Reputation: 43,669

Post » Wed Sep 14, 2016 8:34 am

@spacedoubt

:facepalm:

I always start with the FAQ, but I have missed this thread...

Thanks a lot, I'll try ASAP and let you know :)
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Thu Sep 15, 2016 11:13 am

The Kyatric's solution seems working fine.

Thanks :)
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857

Post » Fri Sep 16, 2016 8:54 am

For the sake of precision, after having tested a while, I choose for another solution: I have created a bigger sprite outside bounderies (so four instance of the same sprite, one per side) and simply check if the ship's sprite is overlapping it.
The reason is that the ships can change their angle while moving and I had often situations where the algoritm suggested that it was still inside boundaries, while it wasn't.
I'm not a insane, my mother had me tested

I'm an engineer. To save time, just assume I'm never wrong
B
31
S
13
G
4
Posts: 141
Reputation: 4,857


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests