My code works when I submit it, but doesn’t work when running it. See code below, that works.
(I hope this is the right way to submit)
if secretA or secretB == "true":
hero.moveXY(32, 33)
hero.moveXY(38, 24)
else:
hero.moveXY(32, 15)
# If secretB is NOT true, take the high path.
if secretB != "true":
hero.moveXY(44, 34)
hero.moveXY(50, 24)
else:
hero.moveXY(44, 15)
The second move statement will only be executed if the ‘if’ statement is true. Instead, no matter which path is selected, you always want the hero to move back to the middle…to do this, the second move statement needs to be outside of the ‘if’ block; ideally, after the ‘else’ statement.