Robot Rumble ALPHA
discord
try it!
boards
tutorial
docs
login
/
signup
targets = [] def init_turn(state): global targets for target in targets: if not state.obj_by_id(target): targets.remove(target) def robot(state, unit): global targets enemies = [obj for obj in state.objs_by_team(state.other_team) if obj.id not in targets] closest_enemy = min(enemies or state.objs_by_team(state.other_team), key=lambda e: e.coords.distance_to(unit.coords) ) targets.append(closest_enemy.id) debug.inspect(closest_enemy) direction = unit.coords.direction_to(closest_enemy.coords) if unit.coords.distance_to(closest_enemy.coords) == 1: return Action.attack(direction) else: return Action.move(direction)
Made with <3 by Anton and Noa
github org