only test if can move before lock

This commit is contained in:
Adrien MALINGREY 2019-09-30 18:30:30 +02:00
parent f5225b3a55
commit d70173f87b

View File

@ -207,7 +207,11 @@ class TetrisLogic():
def lock(self):
# Piece unlocked
if self.move(Movement.DOWN):
if self.can_move(
self.current.coord + Movement.DOWN,
(mino.coord for mino in self.current)
):
self.restart(self.lock, self.lock_delay)
return
# Start lock