Added more controls
This commit is contained in:
parent
2c6c32c34d
commit
8ac4b71665
13
main.py
13
main.py
|
@ -52,6 +52,15 @@ class MazeVisualizer:
|
|||
self.maze = maze.VectorWrapper(maze.OriginShift.clone(self.maze.maze))
|
||||
if event.key == pygame.K_s:
|
||||
if generation_complete: self.maze.step()
|
||||
if event.key == pygame.K_h:
|
||||
for _ in range(100):
|
||||
if not self.maze.step(): break
|
||||
if event.key == pygame.K_t:
|
||||
for _ in range(1000):
|
||||
if not self.maze.step(): break
|
||||
if event.key == pygame.K_m:
|
||||
for _ in range(10000):
|
||||
if not self.maze.step(): break
|
||||
|
||||
# Only step through the algorithm if it's not finished
|
||||
if not generation_complete:
|
||||
|
@ -65,10 +74,10 @@ class MazeVisualizer:
|
|||
pygame.quit()
|
||||
sys.exit()
|
||||
|
||||
CELL_SIZE = 10
|
||||
CELL_SIZE = 5
|
||||
CLOCK_TICK = 20
|
||||
|
||||
MAZE_SIZE = 63
|
||||
MAZE_SIZE = 127
|
||||
VEC_MAZE_SIZE = (MAZE_SIZE + 1) // 2
|
||||
|
||||
# my_maze = maze.RecursiveBacktracker(MAZE_SIZE)
|
||||
|
|
Loading…
Reference in New Issue