summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorSpitfireX <timm.weber@me.com>2015-08-10 18:24:53 +0200
committerSpitfireX <timm.weber@me.com>2015-08-10 18:24:53 +0200
commit5cecd692d0718b452b5e9f25c58187aaa2a04c0b (patch)
tree02b10fcad56b0d7cd7942a098b35986ce606a77c /main.py
parent460ac14b5ee896d95766f68d445888de4096a92f (diff)
Viruses are friends, not food!
Cell logic now ignores viruses as sources of food!
Diffstat (limited to 'main.py')
-rw-r--r--main.py2
1 files changed, 1 insertions, 1 deletions
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)