From: Axy Date: Sat, 21 Mar 2026 04:00:01 +0000 (+0100) Subject: Fixed dumb frame timing issues, now only need to cleanup a bunch of things X-Git-Url: https://git.uwuaxy.net/flexible_layout.mp4?a=commitdiff_plain;h=37f38b1235f493e2ce5d134f7e2dd04d61fda9b5;p=axy%2Fft%2Fa-maze-ing.git Fixed dumb frame timing issues, now only need to cleanup a bunch of things --- 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)