diff options
author | SpitfireX <timm.weber@me.com> | 2015-08-10 18:24:53 +0200 |
---|---|---|
committer | SpitfireX <timm.weber@me.com> | 2015-08-10 18:24:53 +0200 |
commit | 5cecd692d0718b452b5e9f25c58187aaa2a04c0b (patch) | |
tree | 02b10fcad56b0d7cd7942a098b35986ce606a77c | |
parent | 460ac14b5ee896d95766f68d445888de4096a92f (diff) |
Viruses are friends, not food!
Cell logic now ignores viruses as sources of food!
-rw-r--r-- | main.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) |