Robot Rumble ALPHA
discord
try it!
boards
tutorial
docs
login
/
signup
#def robot(state, unit): #if state.turn % 2 == 0: #return Action.move(Direction.East) #else: #return Action.attack(Direction.South) 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) ) direction = unit.coords.direction_to(closest_enemy.coords) print(direction) if unit.coords.distance_to(closest_enemy.coords) == 1: #debug.log("right cell", right_cell) #if right_cell.obj_type == ObjType.Terrain: #direction1=unit.coords.direction_to(ObjType.Terrain) #Action.move(direction1.opposite) if unit.health <= 2: Action.move(direction.opposite) return Action.attack(direction) else: return Action.move(direction)
Made with <3 by Anton and Noa
github org