Skip to main content
1 of 6

#MissilesPlusScore

Some strange idea I came up with that takes that the absolute value of difference of the scores and uses a list of moves in a random based of the game way. Also my first .

function MissilesPlusScore__setup(team) {
var botVars = {};
botVars["color"] = team;
return botVars;
}
function MissilesPlusScore_getActions(gameInfo, botVars) {
var actions = [];
var moves=["fire missile","turn right","turn left","fire engine","fire missile","turn right","turn left",fire missile","turn right","turn left","fire engine","fire missile","turn right","turn left",fire missile","turn right","turn left","fire engine","fire missile","turn right","turn left"];
if(gameInfo[botVars["color"]+"_alive"]){
var num=gameInfo["redScore"]-gameInfo["blueScore"];
if(num<0){num=num*-1;}
if(num===0){actions.push(moves[Math.round(Math.random()*3))];}
else{
actions.push(moves[num+gameInfo["numMissiles"]])
}
}
    return actions;
}