commit f23eae8833fd74104efa94283a3108da58fabea9 Author: Philipp Horstenkamp Date: Sat Apr 9 17:40:30 2022 +0200 init diff --git a/main.mjs b/main.mjs new file mode 100644 index 0000000..f57b471 --- /dev/null +++ b/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); + } +} \ No newline at end of file