summaryrefslogtreecommitdiff
path: root/mechanics.py
diff options
context:
space:
mode:
Diffstat (limited to 'mechanics.py')
-rw-r--r--mechanics.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/mechanics.py b/mechanics.py
index 5f2254b..3aaa405 100644
--- a/mechanics.py
+++ b/mechanics.py
@@ -1,5 +1,13 @@
-def speed(size):
- return 86 / (size**0.45)
+from agarnet.agarnet.world import Cell
+
+def speed(size_or_cell):
+ if isinstance(size_or_cell, Cell):
+ if size_or_cell.is_virus or size_or_cell.is_ejected_mass or size_or_cell.is_food:
+ return 0
+ else:
+ return speed(size_or_cell.size)
+ else:
+ return 86 / (size_or_cell**0.45)
def viewport_diag(sizesum):
return 370 * max(sizesum,70)**0.431776