Browse Source

init

master
Philipp Horstenkamp 4 months ago
commit
f23eae8833
Signed by: philipp
GPG Key ID: DD53EAC36AFB61B4
  1. 11
      main.mjs

11
main.mjs

@ -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…
Cancel
Save