Use different colored flags to perform different tasks.
loop:
flagGreen = self.findFlag("green")
flagBlack = self.findFlag("black")
flagViolet = self.findFlag("violet")
if flagGreen:
self.pickUpFlag(flagGreen)
self.buildXY("fence", self.pos.x+1, self.pos.y)
elif flagBlack:
self.pickUpFlag(flagBlack)
self.buildXY("fire-trap", self.pos.x, self.pos.y)
elif flagViolet:
self.pickUpFlag(flagViolet)
# If there's a green flag, build a fence.
# If there's a black flag, build a fire trap.
# If there's a violet flag, just move to its location.
# Remember to pick up flags after you're done with them!
@ReFinig@tjchan you’re supposed to keep your archers alive by building fire traps to defeat the ogres and block out yaks by building fences.
I find the level is pretty difficult because you don’t get enough warning what’s coming from which direction, so you usually end up placing your flags too late. It’s probably easier to do it without flags and programmatically identify the type of enemy.
The two top left archers are close to the gaps, so I sometimes kill them by accident.
edit 1: Just realized I was playing with the map zoomed in. That makes a difference in difficulty. I think that level is zoomed in by default, because I was zoomed in again when I went to the world and back to the level.
edit 2: Still too difficult for me with flags and building fire traps in time to stop ogres. Especially when they come from the top left. The ogres are too fast and very little advance warning when and where they’re coming from.
edit 3: I also get stuck often when trying to walk past a top left archer.
@funianwuxin
Just noticed you lol i’m sorry , your problem is you haven’t made any movement code , and your codes needs alot of more work , go back to the previous lvls and check them again , that will help alot , if it didn’t help , then come back and let me know , i’ll post some codes over here to help you more
@ReFinig@dideler
Thanks for the thoughts. Will try that. We get some warning from the archers…but I sure hope I don’t have to go buy some faster boots to make me move faster just for this level. =D
Yes, reload helps. Thanks! Now, to beat this level…
@fantuyuan 把你的 “fence” 和 “fire-trap” 放在 flag.pos, 不要放在 self.pos。
(Build your fence or fire trap at flag.pos, not at self.pos.)
@dideler Good catch; I’ve fixed the zoom. and also moved those archers.
You should get 10 seconds’ warning when anything is coming; isn’t that more than enough? In my testing with a slow hero, I didn’t have any problem, but maybe I’m doing something differently.
How are they writing in Chinese / translating? Is there an automated process for this on this forum? Or are they using an external translator and then copying and pasting?
Oh yes! Just passed the level. The flags had to be carefully done as you will always build the fence behind you so unless you are moving first and then returning, you get fenced in to become Sand Yak food. Hahaha.
Thanks Nick. When you said there’s a 10s warning I realized I understood the warnings wrong.
I thought the callouts just prepared you which flag to select and sometimes your allies would look in the direction the enemy would come from, so only when the enemy appeared did I know which direction they were coming from. But now I realized the ally that does the callout also indicates which direction the enemy is coming from. Knowing this I was able to beat the level with no problem.
I was playing the level around 3 am so maybe that’s why I didn’t catch on. Though it wouldn’t hurt to give a hint as a code comment.
BTW, check out this sweet jump I did before I caught on to the hint.
That’s a pretty sweet jump, haha. I have an idea for how to make the incoming markers more clear–when the sentries call out an enemy approaching, the X markers can change color or raise up or something.
Very very fun level. Now I need to figure out how to automate that entire level, since I did all of the flag planting manually. It feels as if it’s totally possible to automate (since for the future, that feels as if it’ll be important).