Created
July 23, 2017 11:13
-
-
Save tawanda-profuse/c25d3d815e267d0ac84c7e86687200c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build traps on the path when the hero sees a munchkin! | |
while(true) { | |
hero.moveXY(41, 20); | |
var enemy = hero.findNearestEnemy(); | |
if(enemy) { | |
// Build a "fire-trap" at the Red X (41, 24) | |
hero.buildXY("fire-trap", 41, 24); | |
} | |
// Add an else below to move back to the clearing | |
else { | |
hero.moveXY(19, 19); | |
} | |
// Move to the Wooden X (19, 19) | |
hero.moveXY(19, 19); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment