From 3bd090b38e54790e5a618c5cc0b1143873f8eb55 Mon Sep 17 00:00:00 2001 From: adrienmalin <41926238+adrienmalin@users.noreply.github.com> Date: Sun, 12 Aug 2018 03:02:37 +0200 Subject: [PATCH] Improve latence by using PreciseTimer --- Tetris2000.py | 2 +- tetromino.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tetris2000.py b/Tetris2000.py index 5d9706c..10e00a9 100644 --- a/Tetris2000.py +++ b/Tetris2000.py @@ -113,8 +113,8 @@ class Matrix(Grid): self.setFocusPolicy(QtCore.Qt.StrongFocus) - self.auto_repeat_delay = 0 self.auto_repeat_timer = QtCore.QTimer() + self.auto_repeat_timer.setTimerType(QtCore.Qt.PreciseTimer) self.auto_repeat_timer.timeout.connect(self.auto_repeat) self.fall_timer = QtCore.QTimer() self.fall_timer.timeout.connect(self.fall) diff --git a/tetromino.py b/tetromino.py index b58351e..c128bac 100644 --- a/tetromino.py +++ b/tetromino.py @@ -125,7 +125,7 @@ class Tetromino: There is no Auto-Repeat for rotation itself. """ rotated_coords = tuple( - block.coord.rotate(self.minoes[0].coord, direction) for block in self.minoes + mino.coord.rotate(self.minoes[0].coord, direction) for mino in self.minoes ) for movement in self.SUPER_ROTATION_SYSTEM[self.orientation][direction]: