Cursed Valley trouble with arrays - Hero Dies (Javascript)


#1

In this level we are required to kill 3 skeletons and drink a potion before the Hero dies, at the same time Hero must not pickup any coins.

Getting to pick only an item-type has NOT been taught in any of the previous games - which I believe is done with the help of arrays - which have NOT been taught before this level.

There is also a video or solution tutorial missing.

Kindly help.


#2

I had made a poster for teacher that went over many concepts. Checking by type was one of them. The posters are here.

Checking for type will be:

items = hero.findItems()
for item in items:
  if item.type is not 'coin':
    pick up the item

#3

Hi! Thank you for the feedback.

Now we have levels about in the Forest map. We’ve added them recently, maybe that’s why you didn’t play them.