diff options
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -57,7 +57,7 @@ while True: c.send_target(runaway_x, runaway_y) print ("Running away: " + str((runaway_x-c.player.center[0], runaway_y-c.player.center[1]))) - gui.debug_line(c.player.center, (runaway_x,runaway_y),(255,0,0)) + gui.draw_line(c.player.center, (runaway_x,runaway_y),(255,0,0)) else: food = list(filter(lambda x: x.is_food or x.mass <= sorted(c.player.own_cells, key = lambda x: x.mass)[0].mass * 0.75 and not x.is_virus, c.world.cells.values())) def dist(cell): return math.sqrt((cell.pos[0]-c.player.center[0])**2 + (cell.pos[1]-c.player.center[1])**2) @@ -65,13 +65,13 @@ while True: if len(food) > 0: c.send_target(food[0].pos[0], food[0].pos[1]) - gui.debug_line(c.player.center, food[0].pos,(0,0,255)) + gui.draw_line(c.player.center, food[0].pos,(0,0,255)) print("Found food at: " + str(food[0].pos)) else: rx = c.player.center[0] + random.randrange(-400, 401) ry = c.player.center[1] + random.randrange(-400, 401) c.send_target(rx, ry) - gui.debug_line(c.player.center, (rx, ry),(0,255,0)) + gui.draw_line(c.player.center, (rx, ry),(0,255,0)) print("Nothing to do, heading to random destination: " + str((rx, ry))) gui.update() |