! Sarven Desert help needed!

My hero only defeats 1 enemy, but then, it stops attacking and doesnt do anything.
Is there anything wrong with my code?
Shared with CloudApp

You will need to move your var enemy = hero.findNearestEnemy() function inside your while-true loop to solve your attacking problem. At the moment, you set enemy at the very start of the world and never update it, so even after the first enemy dies, the enemy variable is still bound to the dead enemy.

The same logic will apply to your coin collection code.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.