From 5cecd692d0718b452b5e9f25c58187aaa2a04c0b Mon Sep 17 00:00:00 2001 From: SpitfireX Date: Mon, 10 Aug 2015 18:24:53 +0200 Subject: Viruses are friends, not food! Cell logic now ignores viruses as sources of food! --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 91feecc..c30a492 100644 --- a/main.py +++ b/main.py @@ -60,7 +60,7 @@ while True: 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, c.world.cells.values())) + 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) food = sorted(food, key = dist) -- cgit v1.2.3