tetris
Diffstat (limited to 'Tetris.gd')
-rw-r--r--Tetris.gd11
1 files changed, 7 insertions, 4 deletions
diff --git a/Tetris.gd b/Tetris.gd
index 92f6661..408a5e5 100644
--- a/Tetris.gd
+++ b/Tetris.gd
@@ -120,10 +120,13 @@ func tick(create_timer := true):
if not current_shape.move(Vector2(0, 1), matrix): # invalid move: cant go down
if current_shape.position.y == 0:
get_tree().reload_current_scene()
- current_shape.embed(matrix)
- current_shape = TetrisPiece.new(Vector2(randi() % (COLUMNS - 4), 0))
- Logic.clear_lines(matrix)
- print(ascii(matrix))
+ if current_shape.stopped:
+ print(ascii(matrix))
+ current_shape.embed(matrix)
+ current_shape = TetrisPiece.new(Vector2(randi() % (COLUMNS - 4), 0))
+ Logic.clear_lines(matrix)
+ else:
+ current_shape.stopped = true
draw_board()