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

Cursed Wonder glade - Help

Here’s my code:

Wonderglade has changed since our last visit.

Ogres cursed it and we should defeat them.

The burl still is collecting gems, so don’t touch them.

Also don’t attack the burl.

while True:
# Find the nearest item.
# Collect it (if it exists) only if its type isn’t “gem”.
item = hero.findNearestItem()
if item:
if item.type != “gem”:
hero.moveXY(item.pos.x, item.pos.y)
# Find the nearest enemy.
# Attack it if it exists and its type isn’t “burl”.
enemy = hero.findNearestEnemy()
if enemy:
if enemy.type != “burl”:
hero.attack(enemy)

The level starts out fine but then a thrower goes behind the burl and my hero does nothing.

Now my hero will go to the burl when an enemy appears and won’t do anything.

please format your code using the image
button.

Welcome to the forum @Marshall_Curtis :partying_face: This is a friendly place where you can ask help on levels, report bugs, or just chat with other coders! Don’t forget to read the guidelines if you haven’t yet. Have a great time!

And yes, as Ritic said, please format you code.

1 Like

do if enemy and enemy.type == "burl":
and did the same thing to if item and if item.type
that should work.

it not a bug i change it to level help categories

Wahh I miss my regulars badge

1 Like

lukas please dont post junk here.
(i still feel bad about it though :frowning: )

1 Like

Yep worry for the off topic but I miss being able to change title names and stuff ;-;