Can't solve ogre-encampment [solved]

Can’t solve this level.


Console output after pressing “Submit” button:

My code:

    enemy = @findNearestEnemy()
    if enemy
        @attack enemy
        @attack enemy
        @attack "Chest"

Btw, everything on the screen looks good. How to solve it correctly?

Your code is fine, but there is a bug in our CoffeeScript transpilation process where it can’t handle nested if-statements instead loops like that. We’ll probably have our work cut out for us fixing it, too. For now I’d recommend playing the later levels in a language other than CoffeeScript, like Python.

Sorry about that!

1 Like

Thanks for answer, i switched to JavaScript and everything fine.