So I’ve been trying to complete the Sarven Road level for a few days now and nothing seems to be working. Here’s my code:
enemies = self.findEnemies()
x = self.pos.x
y = self.pos.y
for enemy in enemies:
loop:
if enemy:
self.attack(enemy)
else:
self.moveXY(x + 10, y + 10)
pass
The problem is my hero isn’t moving. Weirdly, I’ve tried some other stages but he still doesn’t move.
The problem is that you are going through all the enemies and if they are not an enemy you will move.
Everything in enemies is an enemy, so you will never move.