Hey guys! I need help with Sarven Brawl and I will explain everything here. First, the code:
# Stay alive for two minutes.
# If you win, it gets harder (and more rewarding).
# If you lose, you must wait a day before you can resubmit.
# Remember, each submission gets a new random seed.
while True:
enemy = hero.findNearestEnemy()
if enemy:
hero.attack(enemy)
Now that I got the code, I will explain. First, don’t expect me to know everything about Python because I am just a KID. Ok problem:
I am specifically telling the code to attack enemies and it is just doing that. But it attacks SAND YAKS and I don’t want that to happen so I updated my code:
# Stay alive for two minutes.
# If you win, it gets harder (and more rewarding).
# If you lose, you must wait a day before you can resubmit.
# Remember, each submission gets a new random seed.
while True:
enemy = hero.findNearestEnemy()
if enemy.type != "sand-yak":
hero.attack(enemy)
And it is counting the sand yak as the enemy and my hero is not attacking the ogres. Please help!
By the way, I am not a subscriber and I am only 8. Hero: Sir Thatrin Thunderfirst (I just love his fierce look!) So…Please help! @Deadpool198? @AnSeDra? Guys, help! Anyway, you can just call me Surya Raghavan because that is my real name (first and last) Don’t think that I am just in Sarven Desert because I finished the whole game