Simplyfied the code. Ready to rebuild on top of.
This commit is contained in:
17
Room.js
Normal file
17
Room.js
Normal file
@@ -0,0 +1,17 @@
|
||||
module.exports = {
|
||||
setup: function () { Room.prototype = _Room.prototype; }
|
||||
}
|
||||
|
||||
class _Room extends Room {
|
||||
begin(){}
|
||||
|
||||
tick(){
|
||||
const creepsCount = this.find(FIND_MY_CREEPS).length;
|
||||
console.log(creepsCount);
|
||||
if(creepsCount < 5){
|
||||
const spawn = this.find(FIND_MY_STRUCTURES, {filter: {structureType: STRUCTURE_SPAWN}})[0];
|
||||
spawn.createHarvester();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user