Stumped on Thornbush Farm


#1

I really need help with the ‘Thornbush Farm’ level. I have tried for a very long time and whatever I do, nothing works. I either get blown up, blow up a peasant, or walk to some random area and get killed by an ogre. Can anyone help me? I am using the default coding language.


#2

Make a loop and set fire trap to each point/way that ogres comes from ( set trap on the big X )


#3

But when I do that at one point the hero puts a trap when a peasant comes through and it dies. I tried avoiding this by adding the ‘if downEnemy’ statement just like the other two entrances, but it does not work.


#4

Don’t put it exactly on the x make it far a bit and run


#5

I tried and it still does not work. The hero places a mine when a peasant comes and I lose.


#6

Can you give me what you put? Otherwise I will be stumped and can not move on in the game. And I may quit it if nothing works.


#7

It was really easy , just focus next time

# Patrol the village entrances.
# Build a "fire-trap" when you see an ogre.
# Don't blow up any peasants!

loop:
    self.moveXY(43, 50)
    topEnemy = self.findNearestEnemy()
    if topEnemy:
        self.buildXY('fire-trap', 43, 50)
        
    self.moveXY(25, 34)
    leftEnemy = self.findNearestEnemy()
    
    if leftEnemy:
        self.buildXY("fire-trap", 23, 34)
        
    self.moveXY(43, 19)
    buttomEnemy = self.findNearestEnemy()
    if buttomEnemy:
        self.buildXY("fire-trap", 45, 19)

#8

Thank you very much!


#9

My example code is not working, help!


#10

The same thing isn’t working for me either. I’ve heard there is a bug.


#11

Explain what is “not working” what is happening, what are you expecting to happen, etc. Details people.


#12

When I do this it does not count the peasants as enemys


#13

I’ve beaten the level about 5 times in the past few weeks, and it’s never been bugged. What type of bug are you hearing there is?


#14

Hello everyone,

I was trying to complete the Thornbush Farmlevel, but it keeps complaining about an umatched {, while there is none.
Does anyone know how to fix this?

Don’t look at the language, some of it is Dutch because I live in the Netherlands :wink:


#15

Delete the } on line 3?


#16

I tried that but it doesn’t work. I put it there so hopefully it would solve the problem…


#17

Solved it! I had to put an { and than an } at line 1 and then it solved. Very strange…


#18

It also looks like you were missing a } after your if-statement on lines 13-15.


#19

You are right! I retyped the code after the screenprint and typed {} in line 1 and it took that.


#20

Thats a hack. you shouldn’t need to put useless {} pairs to make it work. i think there’s more to it.