Found an expression But expected a Statement: While

maybe check the existence of enemy by

if enemy:

Also… format your code in radiant, harmonious formatting so everyone can easily read it as per FAQs

Cheers