Robot Rumble ALPHA
discord
try it!
boards
tutorial
docs
login
/
signup
def init_turn(state): print(f"{len(state.ids_by_team(state.our_team))} to {len(state.ids_by_team(state.other_team))}") def robot(state, unit): enemies = state.objs_by_team(state.other_team) closest_enemy = min(enemies, key=lambda enemy: enemy.coords.distance_to(unit.coords) ) debug.inspect(closest_enemy) direction = unit.coords.direction_to(closest_enemy.coords) if unit.coords.distance_to(closest_enemy.coords) == 1: debug.log('attacking', closest_enemy.id) return Action.attack(direction) else: return Action.move(direction)
Made with <3 by Anton and Noa
github org