From 2e2c9c9112e5ad50721101739a70c35c3ab9576b Mon Sep 17 00:00:00 2001 From: Yanga Booker <117330346+YangaB7@users.noreply.github.com> Date: Thu, 2 Nov 2023 18:36:41 -0700 Subject: [PATCH] Pipe Deletion Tweak Fixed pipe deletion. Since its possible for the pipe.centerx to get set equal to -600 too quickly, it occasionally stays in the list and slows down performance. --- flappy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flappy.py b/flappy.py index 4c34f8a..294f74c 100644 --- a/flappy.py +++ b/flappy.py @@ -24,7 +24,7 @@ def draw_pipes(pipes): screen.blit(flip_pipe,pipe) def remove_pipes(pipes): for pipe in pipes: - if pipe.centerx == -600: + if pipe.centerx <= -600: pipes.remove(pipe) return pipes def check_collision(pipes):