Browse Source

init

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

11
main.mjs

@ -0,0 +1,11 @@
import { getObjectsByPrototype } from '/game/utils';
import { Creep } from '/game/prototypes';
import { ERR_NOT_IN_RANGE } from '/game/constants';
export function loop() {
var myCreep = getObjectsByPrototype(Creep).find(creep => creep.my);
var enemyCreep = getObjectsByPrototype(Creep).find(creep => !creep.my);
if(myCreep.attack(enemyCreep) == ERR_NOT_IN_RANGE) {
myCreep.moveTo(enemyCreep);
}
}
Loading…
Cancel
Save