summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorSpitfireX <timm.weber@me.com>2015-08-11 15:29:08 +0200
committerSpitfireX <timm.weber@me.com>2015-08-11 15:29:08 +0200
commitb3b745480e0f6770ca0c6947ca7493f90b2f818d (patch)
treecbce3e64f4e87ceed4ebc98eeb45d2091b80b0e3 /main.py
parentf733c96105e41b78d805f2375595074caa929855 (diff)
Increased wall avoidance radius
Diffstat (limited to 'main.py')
-rw-r--r--main.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/main.py b/main.py
index 497d8b0..de19bbc 100644
--- a/main.py
+++ b/main.py
@@ -62,13 +62,14 @@ while True:
forbidden_intervals += canonicalize_angle_interval((angle-corridor_width, angle+corridor_width))
runaway = True
- if c.player.center[0] < c.world.top_left[1]+c.player.total_size:
+ #wall avoidance
+ if c.player.center[0] < c.world.top_left[1]+(c.player.total_size*2):
forbidden_intervals += [(0.5*pi, 1.5*pi)]
- if c.player.center[0] > c.world.bottom_right[1]-c.player.total_size:
+ if c.player.center[0] > c.world.bottom_right[1]-(c.player.total_size*2):
forbidden_intervals += [(0,0.5*pi), (1.5*pi, 2*pi)]
- if c.player.center[1] < c.world.top_left[0]+c.player.total_size:
+ if c.player.center[1] < c.world.top_left[0]+(c.player.total_size*2):
forbidden_intervals += [(pi, 2*pi)]
- if c.player.center[1] > c.world.bottom_right[0]-c.player.total_size:
+ if c.player.center[1] > c.world.bottom_right[0]-(c.player.total_size*2):
forbidden_intervals += [(0, pi)]
if (runaway):