init
This commit is contained in:
commit
f23eae8833
|
@ -0,0 +1,11 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue