Target First Along Path (TD Test)

16
17
0
1

Click & Drag towers to move them


Each tower has a range of 200 pixels (that's the radius of its range circle) and it will target the enemy that is both within its range and is furthest along the path.


THIS VERSION IS BETTER:
https://flowlab.io/game/play/2648595


If performance is a concern there are a few optimizations that could be made:
-Make the towers continuously check for enemies initially, but after an enemy is detected, then only check for enemies at the moment before firing. So if an enemy is in range, they only need to do the math every time they fire. However, this will make them only turn towards their target at the moment they fire instead of continuously turning. And if they fail to find an enemy when they check, then they will need to start continuously checking again.
- Make the enemies send all their info to the brain object, then have the towers request it from the brain and the brain reply with the info. This reduces the amount of messages sent from (the amount of towers)x(the amount of enemies) instead down to (the amount of towers)+(the amount of enemies)

Editor