I have a shell that is fired by artillery. It has a collision shape attached to an area 2d.
I understand that I could do body entered and body exited to build an array of enemies that enter and exit this collision shape as it passes over the battlefield and when it explodes act upon those enemies that are currently in the aray.
The problem is that it could pass hundreds of enemies that are not relevant.
I'd prefer to not build a running array of enemies as they enter and exit, but instead, only check which enemies are within the collisionshape when the shell has reached its destination.
if reacheddestination:
for each enemy in collisionshape:
do damage
any thoughts or ideas would be greatly appreciated.