You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

22 lines
576 B

import { getObjectsByPrototype } from '/game/utils';
import { Creep, Flag, StructureSpawn } from '/game/prototypes';
import { MOVE } from '/game/constants';
var creep1, creep2;
export function loop() {
var mySpawn = getObjectsByPrototype(StructureSpawn)[0];
var flags = getObjectsByPrototype(Flag);
if(!creep1) {
creep1 = mySpawn.spawnCreep([MOVE]).object;
} else {
creep1.moveTo(flags[0]);
if(!creep2) {
creep2 = mySpawn.spawnCreep([MOVE]).object;
} else {
creep2.moveTo(flags[1]);
}
}
}