I have an object that must be filled with spawned objects from the user. The user must have accurated aim because he has few spawnable objects to shoot. I need to calculate how much of area will be occupied / overlap byt these objects.
First I thought about calculating the amount of objects touching the final target. But if the user aims the same spot it would be calculated in a wrong way. The final objective is to fill the whole area and not just "touching" it.
One way to do it is to check if every point on the one object is overlapping an instance of a second object. Think loops with a couple "overlapping point" conditions. This can be slow checking every frame or even every time an object is placed on top so if you use an array to store the polygon area you can progressively do it by smaller area checks. Keep in mind this is based on collision polygons so something visually covered may not calculate as being so.
https://www.dropbox.com/s/bitbk9af918us ... .capx?dl=1
Develop games in your browser. Powerful, performant & highly capable.
Heya — Any chance you could reshare this capx? Thanks bud!