diff options
author | SpitfireX <timm.weber@me.com> | 2015-08-11 00:31:30 +0200 |
---|---|---|
committer | SpitfireX <timm.weber@me.com> | 2015-08-11 00:31:30 +0200 |
commit | 06ec1ca17d38ebb8b1a901b938f5f812e494e26e (patch) | |
tree | ba03b3307ff58a32028c4d9e47082b728c054c66 /main.py | |
parent | a4219f004cea5392fa5e9356ee9f42bc877c8224 (diff) |
Added more debug drawing options
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -25,10 +25,10 @@ except: # connect c.connect(addr,token) -c.send_facebook( - 'g2gDYQFtAAAAEKO6L3c8C8/eXtbtbVJDGU5tAAAAUvOo7JuWAVSczT5Aj0eo0CvpeU8ijGzKy/gXBVCxhP5UO+ERH0jWjAo9bU1V7dU0GmwFr+SnzqWohx3qvG8Fg8RHlL17/y9ifVWpYUdweuODb9c=') +# c.send_facebook( + # 'g2gDYQFtAAAAEKO6L3c8C8/eXtbtbVJDGU5tAAAAUvOo7JuWAVSczT5Aj0eo0CvpeU8ijGzKy/gXBVCxhP5UO+ERH0jWjAo9bU1V7dU0GmwFr+SnzqWohx3qvG8Fg8RHlL17/y9ifVWpYUdweuODb9c=') -#c.player.nick="test cell pls ignore" +c.player.nick="test cell pls ignore" c.send_spectate() @@ -58,7 +58,6 @@ 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.update() 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) @@ -67,15 +66,14 @@ 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.update() 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.update() print("Nothing to do, heading to random destination: " + str((rx, ry))) + gui.update() stats.log_pos(c.player.center) stats.log_mass(c.player.total_mass)
\ No newline at end of file |