The objective of this game is to train your basic programing skill creating a AI for this RTS game(Game of thrones based :D). Create groups with your friends and peer-program AI to fight with each others.
You can check the gamehere.
open index.html
Create a ai.js in ai folders
Extend Player Class like this.
function WalkingDeadPlayer(name){
Player.call(this,name)
}
To add logic create an update function
Now you can iterate from your units and call them for action this
this.update = function(){
for(var i in this.units){
var unit = this.units[i];
unit.attackFirstAvailableTarget();
if(unit.reachTarget()){
var x = randomIntBetween(20,1100);
var y = randomIntBetween(20,600);
unit.goTo(x,y);
}
}
}
Dont forget to add you AI to game in main.js like this.
var walking_dead_player1 = new WalkingDeadPlayer("The walking dead");
world.addPlayer(walking_dead_player1);