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.
 

11 lines
373 B

import { getObjectsByPrototype, findClosestByPath } from '/game/utils';
import { Creep, Flag } from '/game/prototypes';
export function loop() {
var creeps = getObjectsByPrototype(Creep).filter(i => i.my);
var flags = getObjectsByPrototype(Flag);
for(var creep of creeps) {
var flag = creep.findClosestByPath(flags);
creep.moveTo(flag);
}
}