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

What are you supposed to do in the siege of stonehold?


I finally passed the siege of stonehold after trying some of your guys’ sode and adding some of my own. I just built a lot of fire-traps to block off the entrances to the screen. :smile:


Having a lot of difficulty beating this level as the samurai with 183 health (not enough gems to buy better gear). Making it about 2/3 of the way before dying.

Tried using flags but the game runs smoother without flags.

Haven’t tried using the hammer yet.

Edit: Was able to beat it (using sword and no flags) with some minor modifications to my code!


Just a thought, I beat the level in just 5 tries so I’m trying to understand the guidelines for this level:

I did the following:

flag = this.findFlag("green");

if (flag){
    position = flag.pos;
    x = position.x;
    y = position.y;


Then I just ran. Beat the level with 111/145 health. Had them run into the traps (place at forest openings) and my troops killed most of them after the archers and the melee combined forces (they always chase after the nearest enemy so you can “guide” them to form a single unit xD It took 1:35.2. So far I have not spent any on new equipment. I got all the equipment from quest rewards.

So, I guess my question is what is the coding aim for this and how much of it is expected progmatically vs flag manual?


I didn’t design the level, but I assume the only expectation was for it to be challenging.

There aren’t as many restrictions placed on what you can do or what you’re expected to do which gives you a lot of freedom and allows you to be creative. How you play the level is left up to the player.

Well done by the way!


Kannon, did this work well? What was your health?


I’m trying the fire-trap method. Anyone else been looking into how to build fire-traps further away from oneself? Nick said you can build them out by a bit, but I used a modifier to control it a bit more. Any other ideas?

Level: Drop the Flag.


You move into build range and then build; it’s only a few meters. You can’t build any further by adding to the x- or y-values that you’re building at. Otherwise your solution would be great!


thought I’d try! Thanks again, Nick.


Yeah I passed the level, Health was about 1000 i think,


I used fire-traps, with flags to control where I put them. It was (very) chaotic, but by putting traps on all the entrances (and making sure you don’t blow yourself up), it’s quite easy to eliminate Thotkar’s Army.


I’ve done it with different strategies, I think the joy of this level is the ability to try different things:

  1. build fences and lob charges over the top (need the twilight glasses to see through the fence)
  2. build fire-traps at entrances and run away
  3. follow my friends around healing them and staying away from enemies (no extra armor, but I did need the Codec of Life III)
  4. my son did it using the warrior and flags to move and attack

My methods I didn’t use flags at all, just preprogrammed where I wanted to build the fences and fire-traps.


I use a ranged char and lightning stick and about 300 hp and past the level
by going to the entrance of the fort and shooting everything


HELP! I can’t move, I have tried different browsers, placing flags to go to, moveXY, etc. but nothing works!!! Am on the verge of ragequitting because I am out of gems and can neither move or attack so when the troops die I just get pummeled.


Oh and by the way here is my code.

enemy = self.findNearestEnemy()
flag = self.flag
    if enemy:
        if self.isReady("cleave"):
    elif flag:
        flagpos = flag.pos
        fx = flagpos.x
        fy = flagpos.y
        self.moveXY(fx, fy)

Thank you @sotonin for the code help!


Unrelated to your problem. but to get indention to work put on a new line both above and below your code three of these characters `


Do you have the shoes equipped?

Also, and I didn’t thought about this myself, cleaving instead of attacking makes only sense if there is more than one enemy next to you. A normal attack is both more powerful and faster than a cleave-attack, but has of course no Area-Damage.


I think so. Also in this level the enemies tend to mob you.


A couple basic things. You are getting nearest enemy outside the loop, so all through the code, you enemy will always be empty because there was no enemy the instant the games started. Similarly you get the flag outside the loop, though for the flag line, your code is wrong. self.flag is nothing, you need self.findFlag().

Your current code should have you always shielding because both enemy and flag are always null.


I am experiencing a bug where out of nowhere my health drops to negative twelve at 1.12.7 from 498. Any help?


I have beaten the level! Bug turned out to be me not looking for a second while ogres ganged up on me, silly me. Anyway, I used flags to direct me out of the way when I was low on hit points, because I moved flags up so I checked for flags and went to them first so I kept myself out of the way while my troops beat up everything else. Thanks for all the help, and good luck!