New Level: Munchkin Harvest


#1

Check it out here. For all you players wanting to know how to unlock the Ranger, well we now have an answer: beat this level to unlock Amara Arrowhead. The next two levels after this were built to show players how to use the rangers and wizards and we’d love to know how well they do at differentiating warrior vs ranger strategies.


#2

Ah, very nice. Just a small note, when I got through this level the victory screen looks like this:

I think too many items to fit into the victory box.


#3

Ah yeah, that’ll be fixed as soon as we implement the new design for the victory modal (it’s going to look pretty sweet).


#4

Smart. Any suggestion to unlock this level? I tried many times, but it seemed that the hero’s blood was too thin to sustain to the end.


#5

I need help on this level, how do I beat it?

loop:
enemy = self.findNearestEnemy()
if enemy: 
self.cleave(enemy)
else:
self.shield()

I have indents,


#6

I think rather than shielding, try attacking the munchkins as they turn up. They seem to come in singly for a while, and then a big group just as the cleave becomes ready. But still need enough armor to survive too.


#7

Or invest on items that give more life points. Ex. Tougher Armor and Head Gear.


#8

Yeah, I have it on my TODO list to indicate in the comments that you should probably cleave and attack instead of cleaving and shielding; that’s the easiest way to do it, anyway. You also need to make sure you have over 300 health.


#9

Nice, I’ll try to get 300+ health.


#10

I can’t seem to beat this level and it’s extremely frustrating. That is my code, I have indents, and I have over 400 health. What am I doing wrong?

loop {
    var enemy = this.findNearestEnemy();
    if (enemy) {
        this.cleave(enemy);
    } else {
        this.shield();
    }
}

#11

Did you try this one?


#12

Yeah, it still doesn’t work.


#13

It works fine, but your condition does not make sense.

loop {
    var enemy = this.findNearestEnemy();

    // Are there enemies nearby?
    if (enemy) {
        // Yes, there are enemies nearby.
        this.cleave(enemy);
    } else {
        // No, there aren't any enemies around.
        this.shield();
    }
}

Try this instead:

// Is the cleave action ready?
if (this.isReady("cleave")) {
    // Yes, the action is ready.
    this.cleave(enemy);
} else {
    // No, I can't use cleave right now.
    this.shield();
}

#14

Thank You! That was really helpful and I just completed it! I did have like, 1300 health points but I did complete it! Thanks!


#15

Here’s the code and i have 700 of health. After the first round, it seems like the loop is stopping and my fighter is not looking for enemies

loop:
enemy = self.findNearestEnemy()
if self.isReady(“cleave”):
self.cleave(enemy)
else:
self.attack(enemy)

I do get a warning about target is nul

Any help is much appreciated :slight_smile:


#16

Could you have a go at formatting your code as per the FAQ - given that its Python the whitespace makes quite a difference :smile:


#17

You need a if enemy: because self.findNearestEnemy() doesn’t always find an enemy and when there isn’t one the code get’s an error and stops.


#18

Where do i put that if enemy? Before or after checking that cleave is ready?

And where do i find the FAQ if it really is just a white space issue?

Thanks for your help


#20

“If enemy” goes between setting and using “enemy” . . . not much point checking if enemy exists if you already failed trying to attack/cleave/etc it…

The FAQ is one of the posts “pinned” to the top of the message/post/thread-s list.


#21

Hi,
something is wrong with my code :frowning:
while(true) {

var enemy = hero.findNearestEnemy();
if (hero.isReady("cleave")) {
hero.cleave(enemy);

} else {
hero.attack(enemy);
}
}
I’ve no idea what is wrong but i can’t harvest Muchking .
Any suggestion?
Thank’s