summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcameltris.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/cameltris.py b/cameltris.py
index 6d33718..cf29a72 100755
--- a/cameltris.py
+++ b/cameltris.py
@@ -208,6 +208,9 @@ class Player:
return len(rows_to_burn)
def lock_piece(self):
+ if self.has_collision(self.current_piece_position[0], self.current_piece_position[1]):
+ raise WouldCollide()
+
for row_id, row in enumerate(self.current_piece.elements):
for col_id, element in enumerate(row):
if element is None: