Alternative Dueling Grounds Strategy

So myself and a friend decided attacking was too mainstream. We decided to come up with a new approach so here it is. Operation CowardBOOM

`var enemy = this.findNearestEnemy();
     var i = 0;
     this.moveXY(9, 12);
     this.buildXY("fence", 13, 12);
     this.buildXY("fence", 9, 16);
     while (enemy.health > 0) {
         var enemyx = enemy.pos.x;
         var enemyy = enemy.pos.y;
         if (i < 8) {
         this.buildXY("fire-trap", 12.81, 14.84);
         i += 1;
         } else {
         this.shield();
         }
     }`

This code will basically run to the corner, build some walls and then place enough bombs to kill the enemy and hopefully not you. At the moment it is working for Simple AI but I’ll be improving it and I’ll keep you guys updated! Let us know if you have any suggestions or any alternate strategies of your own.

2 Likes

If the code is killing you or not killing the enemy you simply need to adjust the i variable which is the number of traps to be set. This code will only work if you have more health than your opponent! Find out how many bombs you can survive and set that as the value of i in the loop.