summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-11 14:55:13 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-11 14:55:13 +0200
commitf733c96105e41b78d805f2375595074caa929855 (patch)
tree9e1b4382ac0ebe10f979194b2461425b91188b5b /main.py
parent8878a33c6cd954e995782fc87f501227ab4bac4d (diff)
hopefully fix virus avoidance
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 65072a7..497d8b0 100644
--- a/main.py
+++ b/main.py
@@ -56,7 +56,7 @@ while True:
relpos = ((cell.pos[0]-c.player.center[0]),(cell.pos[1]-c.player.center[1]))
dist = math.sqrt(relpos[0]**2+relpos[1]**2)
- if (not cell.is_virus and dist < 500+2*cell.size and cell.mass > 1.25 * my_smallest) or (cell.is_virus and dist < cell.size and cell.mass < my_largest):
+ if (not cell.is_virus and dist < 500+2*cell.size and cell.mass > 1.25 * my_smallest) or (cell.is_virus and dist < my_largest and cell.mass < my_largest):
angle = math.atan2(relpos[1],relpos[0])
corridor_width = 2 * math.asin(cell.size / dist)
forbidden_intervals += canonicalize_angle_interval((angle-corridor_width, angle+corridor_width))