Skip to content
Snippets Groups Projects
Commit 7212e11a authored by Mattias Ljungstrom's avatar Mattias Ljungstrom
Browse files

level gen: require empty start/goal positions

parent 1664efd1
No related branches found
No related tags found
No related merge requests found
...@@ -338,8 +338,8 @@ def complex_rail_generator(nr_start_goal=1, min_dist=2, max_dist=99999, seed=0): ...@@ -338,8 +338,8 @@ def complex_rail_generator(nr_start_goal=1, min_dist=2, max_dist=99999, seed=0):
start = (np.random.randint(0, width), np.random.randint(0, height)) start = (np.random.randint(0, width), np.random.randint(0, height))
goal = (np.random.randint(0, height), np.random.randint(0, height)) goal = (np.random.randint(0, height), np.random.randint(0, height))
# check to make sure start,goal pos is empty? # check to make sure start,goal pos is empty?
# if rail_array[goal] != 0: # or rail_array[start] != 0: if rail_array[goal] != 0 or rail_array[start] != 0:
# continue continue
# check min/max distance # check min/max distance
dist_sg = distance_on_rail(start, goal) dist_sg = distance_on_rail(start, goal)
if dist_sg < min_dist: if dist_sg < min_dist:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment