diff options
author | Florian Jung <flo@windfisch.org> | 2015-09-01 20:40:10 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-09-01 20:40:10 +0200 |
commit | 7c1180a7b58e7b8c17c8dab297058d0c001386c6 (patch) | |
tree | 76a21545963ba482fa025935b55768b0cfe04276 /mechanics.py | |
parent | e06a42f55444eba9bac38103dbc82425d282a310 (diff) |
try to chase less
Diffstat (limited to 'mechanics.py')
-rw-r--r-- | mechanics.py | 12 |
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 |