Added more controls

This commit is contained in:
Kyler Olsen 2024-11-05 00:27:40 -07:00
parent 2c6c32c34d
commit 8ac4b71665
1 changed files with 11 additions and 2 deletions

13
main.py
View File

@ -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)