summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/main.py b/main.py
index a4c77f2..af452fa 100644
--- a/main.py
+++ b/main.py
@@ -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