The Final Kithmaze help

Again, i will put this into Python terms

hero.moveRight()
hero.moveUp()
enemy = hero.findNearestEnemy()
hero.attack(enemy)
hero.attack(enemy)
hero.moveRight()
hero.moveDown(2)
hero.moveUp()

it says that there is too much indentation at the beginning
(loop)
self.moveRight() right here
self.moveUp()
enemy = self.findNearestEnemy()
self.attack(enemy)
self.attack(enemy)

Why are you using self? Are you using someone else’s code, or have you started again from playing ages ago?
Danny
P.S. loop doesn’t work any more either.

I’ve started again from playing ages ago @Deadpool198

I thought that might be it; well, I would suggest just reloading the level (the bottom in the top right of the level screen) and starting again with the new functions:
while True instead of loop and hero instead of self.

I do not remember how I beat it sorry but I will be of no help

oof srry but I can’t help

why can’t we post the solutions we have?

Because it completely ruins the conception of learning) We have to find solutions by ourselves not to copypaste ones we see from other players on the forum or elsewhere.

oh ok thanks for telling me

1 Like

use a for loop instead?

there is a prob in my code after I kill the second enemy I die because my code loops me going up and I get hit by the spikes!

Hi @Spacemanic and welcome to the forum! :partying_face:

Can you show us your code formated as it is described here so we will help you solve the level?

2 Likes

while True:
hero.moveRight()
hero.moveUp()
hero.moveRight()
hero.moveDown()
hero.moveDown()
hero.moveUp()
hero.moveRight()
enemy = hero.findNearestEnemy()
hero.attack(enemy)
hero.attack(enemy)
this is it

Try to format it as it is described here.

1 Like

Many thanks, will give that a try :wink:

2 Likes

Hi, I don’t really need help it’s just that I don’t understand why I don’t have more levels in Dungeon. This is a screenshot of my map.


like the levels are blue and locked. AND I am on Forest/ then when I realized my Lil bro which just started code combat, so that means he is still on the dungeon, he has the levels that are locked open on his. Here is a screenshot of my Lil bro’s:


notice that all of the levels on mine that locked is open and he just started CodeCombat.
How do I fix this??? Thanks :blush:

Are you a sub? 20 chars

wdym? 20 characters(

Are you a subscriber?