From 37f38b1235f493e2ce5d134f7e2dd04d61fda9b5 Mon Sep 17 00:00:00 2001 From: Axy Date: Sat, 21 Mar 2026 05:00:01 +0100 Subject: [PATCH] Fixed dumb frame timing issues, now only need to cleanup a bunch of things --- __main__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/__main__.py b/__main__.py index 85934b6..4e15931 100644 --- a/__main__.py +++ b/__main__.py @@ -52,18 +52,17 @@ def clear_backend() -> None: class Tick: - tick: float = time.monotonic() + tick: float | None = None def display_maze(maze: Maze) -> None: now = time.monotonic() - if now - Tick.tick < 0.016: + if Tick.tick is not None and now - Tick.tick < 0.016: return Tick.tick = time.monotonic() clear_backend() # pathfind() - backend.set_style(full.curr_style()) rewrites = { wall for wall in dirty_tracker.curr_dirty() if maze.get_wall(wall) @@ -74,6 +73,7 @@ def display_maze(maze: Maze) -> None: if maze.check_coord(e) and maze.get_wall(e) } + backend.set_style(full.curr_style()) for wall in rewrites: for pixel in wall.tile_coords(): backend.draw_tile(pixel) @@ -117,12 +117,10 @@ if config.exit is not None: pattern = Pattern(config.maze_pattern).centered_for(dims, excluded) pattern.fill(maze) - maze.outline() walls_const = set(maze.walls_full()) - maze_make_perfect(maze, network_tracker, callback=display_maze) maze_make_pacman(maze, walls_const, pacman_tracker, callback=display_maze) -- 2.53.0