I cannot seem to get my cannon to fire. Here’s the code I’m trying to use, but it’s not making any sense to me. My first problem is that I can’t seem to reveal any of the coordinates I need to bomb. Secondly, my cannon is not getting the commands to fire. Any suggestions to get me going in the right direction?
while (true) {
var enemy = this.findNearestEnemy();
if(enemy) {
var pos = enemy.pos;
x = enemy.pos.x;
y = enemy.pos.y;
// say the x and y position separated by a comma
this.say( 62 +"," +51);
this.say("Fire!");
} else {
this.say("Cease" + " Fire!");
this.throw(enemy);
}
}