diff options
author | SpitfireX <timm.weber@me.com> | 2015-08-11 02:09:58 +0200 |
---|---|---|
committer | SpitfireX <timm.weber@me.com> | 2015-08-11 02:09:58 +0200 |
commit | dd6832293786ea0f3e7ba872893734db9fd1c30b (patch) | |
tree | f7eb456a32d4fd0d19d2980a8aded54e637ef9e7 /main.py | |
parent | 06ec1ca17d38ebb8b1a901b938f5f812e494e26e (diff) |
Some more gui.py improvements
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() |