Simplyfied the code. Ready to rebuild on top of.

This commit is contained in:
unknown
2023-08-20 16:31:21 +02:00
parent 15c86d3c14
commit ae3812aa83
10 changed files with 71 additions and 137 deletions

17
Room.js Normal file
View 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();
}
}
}