Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[SOLVED] Sarven Road Python help

#1

Just a warning,this is my first post so I may not format my code properly.In the level “Sarven Road” my hero cannot seem to move. 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:
    # If there's an enemy, attack.
    xPos = hero.pos.x
    yPos = hero.pos.y
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.attack(enemy)
        hero.attack(enemy)
        hero.attack(enemy)
    # Else, keep moving up and to the right. 
    else:
        hero.pos.x + 3
        hero.pos.y + 3
        
    pass
    

If there is more information that you need to solve this problem, please tell me

#2

Never mind. …I figured it out.

1 Like
#3

Cool, sorry I didn’t reply earlier. I must have missed your post. :confused:
:lion: :lion: :lion: