Base the boundary on tweakable values
This commit is contained in:
@@ -4,17 +4,19 @@ try:
|
||||
except ImportError:
|
||||
import numpy as np
|
||||
|
||||
boundary_lines = [
|
||||
[(0,0), (0, 1500)],
|
||||
[(0, 1500), (1500, 1500)],
|
||||
[(1500, 1500), (1500, 500)],
|
||||
[(1500, 500), (1000, 500)],
|
||||
[(1000, 500), (1000, 0)],
|
||||
[(1000, 0), (0, 0)],
|
||||
]
|
||||
|
||||
width = 1500
|
||||
height = 1500
|
||||
cutout_width = 500
|
||||
cutout_height = 500
|
||||
|
||||
boundary_lines = [
|
||||
[(0,0), (0, height)],
|
||||
[(0, height), (width, height)],
|
||||
[(width, height), (width, cutout_height)],
|
||||
[(width, cutout_height), (width - cutout_width, cutout_height)],
|
||||
[(width - cutout_width, cutout_height), (width - cutout_width, 0)],
|
||||
[(width - cutout_width, 0), (0, 0)],
|
||||
]
|
||||
|
||||
def contains(x, y):
|
||||
"""Return True if the point is inside the arena.
|
||||
@@ -25,7 +27,7 @@ def contains(x, y):
|
||||
or y < 0 or y > height:
|
||||
return False
|
||||
# is it inside the cutout?
|
||||
if x > 1000 and y < 500:
|
||||
if x > (width - cutout_width) and y < cutout_height:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user