From c1eecfd567aacc3e1f07940b869956f5056d88a4 Mon Sep 17 00:00:00 2001 From: Thaloria Date: Sun, 30 Jul 2023 15:05:47 +0200 Subject: [PATCH] update flappy --- flappy.py | 4 ++-- flappy_pos_discovery_thread.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flappy.py b/flappy.py index 55e7494..d948a43 100644 --- a/flappy.py +++ b/flappy.py @@ -21,10 +21,10 @@ class Flappy(GameBase): tmp = 20 self.click() cv.waitKey(int(100)) - if tmp % 5 == 0: + if tmp % 5 == 1: self.click() cv.waitKey(int(wait_timer -100)) - + print("pet_pos: ", self.flappy_pos_disc.get_actual_pet_height()) ''' 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 diff --git a/flappy_pos_discovery_thread.py b/flappy_pos_discovery_thread.py index 4664660..9c6e0f9 100644 --- a/flappy_pos_discovery_thread.py +++ b/flappy_pos_discovery_thread.py @@ -52,8 +52,8 @@ class FlappyPosDiscovery(threading.Thread): if len(rectangles_f) is not 0: self.current_pet_height.append(rectangles_f[0][1] + rectangles_f[0][3] + self.offset_down) - if len(self.next_gate_height) > 5: - self.next_gate_height.pop(0) + if len(self.current_pet_height) > 5: + self.current_pet_height.pop(0) #print("pet_pos: ", self.current_pet_height) #print("next gate: ", self.next_gate_height)