In my Tanks! Template I improved the enemy AI. It has a patrol state going to random areas instead of an idle state. If the player is on sight it shoots. If the player is near enough but not in sight, then it goes in a pursuit mission. But if the player goes away too far, the enemy moves in random directions until it finds the target again.