Another day, another newbie question!
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.
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
I always start with the FAQ, but I have missed this thread...
Thanks a lot, I'll try ASAP and let you know
The Kyatric's solution seems working fine.
Develop games in your browser. Powerful, performant & highly capable.
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.