Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team


The link above is the level I’m getting trouble with.

points = [{'x':22, 'y':109}, {'x':129, 'y':109}, {'x':132, 'y':27}, {'x':23, 'y':22}]
index = 0

while True:
    enemy = hero.findNearestEnemy()
    if enemy:
        hero.move(points[index % len(points)]
    if hero.pos.x == points[index % len(points)].x and hero.pos.y == points[index % len(points)].y:
        index += 1

This is my code. I got error message at line 9, which says “Unexpected token: expected T_NAME but found T_COLON while parsing test”. My code worked fine on other levels tho. Why is this happening?

Hi. Maybe missed “)” at the end of the line down here?

1 Like

How can I be this stupid! Thank you :smiley:

You’re welcome) I stuck in such traps many times) Especially while copypasting code from other levels)