Stumped on Breakout :(


#1

Hello, recently I have been doing code combat and I am stuck on the level “Breakout” in the Kithgard Dungeon. If anyone could help me that would be greatly appreciated. The code I write seems to work but at the end of the level my character seems to stop breaking the door and dive into the huge wave of Munchkins.

hero.moveRight()
hero.attack(“Weak Door”)
hero.moveRight()
hero.moveDown()
while True:
hero.attack(“Door”)

^ That is the code I am doing and once my character is finished breaking the door he seems to rebel and walk into the Munchkins. This is frustrating me a bit and I would like to get done with this level. I would love some feedback.

Thanks,
JDubC


#2

Because you are using simple boots, after you attack you go where you were before attacking. You should move toward the door and the have the attacking.


#3

Could you phrase that a bit differently?
EDIT: I have looked up people doing the level and their code is the same as mine, but they complete the level. One thing I noticed is that the thing at the end of the hallway opens up and shoots out what appears to seem to be fire.
EDIT 2: Would I have to use a different hero for different levels? I have only been playing with Alejandro the Duelist and I have seem to get pass most of the levels just fine. (Ya know except this one.)
Thing that was mentioned in the edit.


#4

I have solved the problem! Thanks kaiduck for the help.