Sarven road help please


#1

this is my code

# Get to the oasis. Watch out for new enemies: ogre scouts!
# Go up and right by adding to the current X and Y position.
enemy = hero.findNearestEnemy()
xPos = 10
yPos = 14
while True:
    # If there's an enemy, attack.
    if enemy:
        hero.attack(enemy)
        # Else, keep moving up and to the right. 
    else:
        hero.moveXY(xPos + 3, yPos + 3)
        pass

It does not attack munchkins and not moving great


#2

you have to put the xPos and yPos and findNearest enemy in the while loop so it continuasly finds enemies and other stuff


#3

now my hero attacks the munchkins but does not move


#4

Increment the XPos and the YPos so it adds after each loop, then tell the hero to move to the new incremented position


#5

Instead of xPos and Ypos put hero.pos.x + 3 and hero.pos.y +3 its the same thing


#6

I think that helps a lot but my code doesn’t change or its I don’t understand the meanings of what you’re saying.
Here is my code:

# Get to the oasis. Watch out for new enemies: ogre scouts!
# Go up and right by adding to the current X and Y position.
while True:
    enemy = hero.findNearestEnemy()
    xPos = 10
    yPos = 14
    # If there's an enemy, attack.
    if enemy:
        hero.attack(enemy)
        # Else, keep moving up and to the right. 
    else:
        hero.pos.y + 3
        hero.pos.x + 3
        pass

#7

oh wait I got a totally different code and it could not do it so I just bought the runesword and did it


#8

I meant like moveXY(hero.pos.x+3, hero.pos.y)


#9

Have you completed the level with the RuneSword?


#10

He did. Read his post.