From 804f178fbf003a2f3f2a5c9f52320aa6e2501c36 Mon Sep 17 00:00:00 2001 From: Thaloria Date: Sun, 30 Jul 2023 15:08:29 +0200 Subject: [PATCH] update flappy --- flappy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flappy.py b/flappy.py index d948a43..6c1acbb 100644 --- a/flappy.py +++ b/flappy.py @@ -21,8 +21,10 @@ class Flappy(GameBase): tmp = 20 self.click() cv.waitKey(int(100)) - if tmp % 5 == 1: - self.click() + if self.flappy_pos_disc.next_gate_height[0] is not 0: + offset = (self.flappy_pos_disc.next_gate_height[0] + 120) - self.flappy_pos_disc.current_pet_height + if offset > 50: + self.click() cv.waitKey(int(wait_timer -100)) print("pet_pos: ", self.flappy_pos_disc.get_actual_pet_height()) '''