diff options
Diffstat (limited to 'strategy.py')
-rw-r--r-- | strategy.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/strategy.py b/strategy.py index dbe7cd1..c570d2d 100644 --- a/strategy.py +++ b/strategy.py @@ -219,8 +219,13 @@ class Strategy: forbidden_intervals = merge_intervals(forbidden_intervals) allowed_intervals = invert_angle_intervals(forbidden_intervals) + + try: + (a,b) = find_largest_angle_interval(allowed_intervals) + except: + print("TODO FIXME: need to handle no runaway direction being available!") + (a,b) = (0,0) - (a,b) = find_largest_angle_interval(allowed_intervals) runaway_angle = (a+b)/2 runaway_x, runaway_y = (self.c.player.center[0]+int(100*math.cos(runaway_angle))), (self.c.player.center[1]+int(100*math.sin(runaway_angle))) |