Help me

for first game : 2 Danger imminent help me

For every game loop, reads the distance of enemies and shoot the closest :wink:

1 Like

For every game loop, reads the distance of enemies and shoot the closest

I understand that it shoots the closest enemy but it seems to me like the loop runs slowly. It only shoots the Buzz enemy when it’s 0 distance away. Any hints you can throw my way? It solves case 1 but only barely and it’s making case 2 more difficult.

how are you finding the closest enemy? if you are using a variable to store the nearest location, remember to reset it after the loop, otherwise the turret only shoots when they get closer than the one that died was.