My hero survives with 2995 health.
But I didn’t use the invisibility ring.
It took me about a week of tweaking my code before I could survive long enough to get the 60 second bonus. I kept changing heroes and tactics and slowly lasting longer and longer until I finally got it on the bazillionth try.
Not necessarily. It blows up when I run my code too. It just has to survive for 30 seconds to pass the level. I noticed when I ran your code that you’re not continuously collecting coins. It’s seems to stop for a while and then begin again. This isn’t good because it limits the number of griffin riders you can summon. You need as many as possible to keep the ogres and munchkins away from the minefield for as long as possible.
Edit: It appears that once Tharin commands the griffin-riders to attack, he no longer goes back to collecting coins. Also, once the first fang-rider is killed, he keeps attacking even after its dead.
It appears that once the code begins a function, it gets stuck in that function. If you summon a griffin-rider, he stands in one place swinging his sword, presumably summoning that one griffin-rider over and over again. Once you attack, the code is stuck in the attack function until another condition is introduced that causes the code to move on to another function.
I managed to pass the level using your code and equipment by simply changing the move method to moveXY in the pickUpCoin() function. However, if you’re going to go after the 60 second bonus, it’s going to take a lot of reconstruction. This level works a ton better when you use arrays.
I tweaked a little bit your code and beat the level with the bonus with no so good armor.
def chooseStrategy(): # .... your code here # if enemy.type is "fangrider" and hero.distanceTo(enemy) < 30: # fangriders must be on the left to the mines if enemy.type is "fangrider" and enemy.pos.x < 38: # my function doesn't return "collect-coins" commented the rows # else: # return "collect-coins" def heroAttack(): # Your code here # same logic as above # if enemy and hero.distanceTo(enemy) < 30: if enemy and enemy.type == 'fangrider' and enemy.pos.x < 38: hero.attack(enemy) loop: # Your code here elif strategy == "fight-back": heroAttack() # Collect coins unconditionally after summoning and killing intruders # elif strategy == "collect-coins": pickUpCoin()
You can improve pickUpCoin() , summon a peasant to help you collecting coins, replace
for griffin in hero.findByType("griffin-rider"): # with griffins = hero.findByType("griffin-rider") for griffin in griffins:
for not making a call to a method on every iteration
Wow. Didn’t know that, thanks. But have no idea, why is it so.
btw guys, you know that you can go through the landmine, right? (you can literally walk through it)
I killed enemies myself before 35 seconds, then shielded for the rest of the time. Easy (Need max armor tho)
Didn’t know that. Didn’t even try it. I spent a week on this level, changing heroes and strategies, tweaking it little by little until I got the 60 second bonus. But then, I like to follow directions to get the point of the lesson. I’ve even made some notes of things I want to go back and change when I get time to improve it.
Well, if you are Ritic, then you can literally rig the landmines so the enemies can’t get to it (shadow vortex) then you can scattershot everything in the vortex. Easy!
Thanks for all the help!
after some time I got it to work
This is weird when I ran it, it said success but when I submitted it, it said incomplete?
Just submit again until you get a seed that works.