From b24a835f18b1c36aa6c7476984abbe7c4cb29cab Mon Sep 17 00:00:00 2001 From: Thaloria Date: Sun, 30 Jul 2023 10:08:33 +0200 Subject: [PATCH] update litris with board detection --- litris.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/litris.py b/litris.py index 1933808..01d2620 100644 --- a/litris.py +++ b/litris.py @@ -50,7 +50,7 @@ class Litris(GameBase): continue if self.overlay.run_mode == 'stopped' or self.overlay.run_mode == 'paused': return - cv.waitKey(50) + cv.waitKey(25) continue @@ -95,7 +95,7 @@ class Litris(GameBase): self.field.cleared_rows = 1 - cv.waitKey(200) + cv.waitKey(100) self.stone_id_thread.set_pick_up_status(False) def update_field_with_stored_edges(self): @@ -126,7 +126,7 @@ class Litris(GameBase): self.keyboard.press(down) self.keyboard.release(down) print("drop down pressed:", down) - cv.waitKey(50) + cv.waitKey(40) def update_move_mode(self): if self.move_mode <=3: @@ -159,13 +159,13 @@ class Litris(GameBase): self.keyboard.press(down) self.keyboard.release(down) print("direction pressed: ", down) - cv.waitKey(120) + cv.waitKey(60) if rotation == 3: self.keyboard.press('e') self.keyboard.release('e') print("rotation 1 pressed: e") - cv.waitKey(40) + cv.waitKey(30) elif rotation == 2: self.keyboard.press('e') self.keyboard.release('e') @@ -179,28 +179,28 @@ class Litris(GameBase): self.keyboard.press('e') self.keyboard.release('e') print("rotation 3 pressed: e 1") - cv.waitKey(20) + cv.waitKey(30) self.keyboard.press('e') self.keyboard.release('e') print("rotation 3 pressed: e 2") - cv.waitKey(20) + cv.waitKey(30) self.keyboard.press('e') self.keyboard.release('e') print("rotation 3 pressed: e 3") - cv.waitKey(20) + cv.waitKey(30) if col_movement < 0: for i in range(0, col_movement, - 1): self.keyboard.press(left) self.keyboard.release(left) print("move left 3 pressed:", left) - cv.waitKey(40) + cv.waitKey(30) else: for i in range(0, col_movement, 1): self.keyboard.press(right) self.keyboard.release(right) print("move right 3 pressed:", right) - cv.waitKey(40) + cv.waitKey(30) def point_in_rect(self, point): for e in range(0, 20, 1):