Robot Rumble ALPHA
discord
try it!
boards
tutorial
docs
login
/
signup
def robot(state, unit): enemies = state.objs_by_team(state.other_team) closest_enemy = min(enemies, key=lambda e: e.coords.distance_to(unit.coords) ) centerDistance = unit.coords.walking_distance_to(Coords(10,10)) enemyNext=(unit.coords.distance_to(closest_enemy.coords)==1) if unit.coords==Coords(10,10): if not enemyNext: return None else: return Action.attack(unit.coords.direction_to(closest_enemy.coords)) if (centerDistance == 1 or centerDistance == 2): if enemyNext: return Action.attack(unit.coords.direction_to(closest_enemy.coords)) else: return None if centerDistance >= 3: if not enemyNext: return Action.move(unit.coords.direction_to(Coords(10,10))) else: return Action.attack(unit.coords.direction_to(closest_enemy.coords)) return None
Made with <3 by Anton and Noa
github org