So I have been looking at games of bots in the top 50 ranks and I notice a pattern were a ship would come to attack an enemy ship, do the attack (or sometimes not) and then immediately retreat some 20 units back, only to come back again for another attack.
I understand the tactic it self, but I don't know how to code it. Specifically, what I mean, is that the turn loop don't go fast enough to detect right when an attack has happened. I am coding in Java, and using an infinite loop that only seems to get called once every turn isn't fast enough to detect when an attack has taken place and to then tell the ship to retreat. How do I get a 'faster' loop?