Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

[SOLVED] undefined in Underground Business


The level seemed pretty simple, but I can’t get my hero to move to the X if I use in the code. I inserted the pet.debug command to tell me the value of, and it claims that it’s “undefined”.

I’m posting my stripped down code here. This is an attempt to isolate the problem, not solve the level. Am I doing this thing wrong somehow?

# Accumulate 300 gold and escape from the dungeon.

def onSpawn(event):
    # Send the pet to walk around the dungeon:
    pet.moveXY(20, 58)
    pet.debug("hero's gold is " +
    pet.moveXY(71, 58)
    pet.moveXY(71, 11)
    pet.moveXY(20, 11)
    pet.moveXY(hero.pos.x, hero.pos.y)
    pet.debug("hero's gold is " +

pet.on("spawn", onSpawn)

while True:
    if hero.time > 500:
        hero.moveXY(50, 34)


Argh, nevermind, I figured it out. Looks like the Quartz Sense Stone is required for to work. That should probably be required equipment for this level.

Funny how you spend an hour trying to solve a problem, and find the answer one minute after posting!


changed title to [SOLVED]


Try telling them this in PM’s next time. :wink:


oka (argh I hate 20 char)


Thanks, I’ll know next time.