summaryrefslogtreecommitdiff
path: root/cameltris.py
diff options
context:
space:
mode:
Diffstat (limited to 'cameltris.py')
-rwxr-xr-xcameltris.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cameltris.py b/cameltris.py
index 9876aa3..5d1d9ba 100755
--- a/cameltris.py
+++ b/cameltris.py
@@ -141,13 +141,16 @@ def refresh_game_canvas():
game_canvas.blit(element, ((col_idx + current_piece_position[1]) * 50 + 1, (row_idx + current_piece_position[0]) * 50 + 1))
def refresh_right_pane_canvas():
+ level_canvas.fill(black)
score_canvas.fill(black)
if pygame.font:
score_font = pygame.font.Font(None, 56)
score_canvas.blit(score_font.render(f"{score:08d}", True, white), (0, 0))
+ level_canvas.blit(score_font.render(f"{level:08d}", True, white), (0, 0))
right_pane_canvas.blit(score_canvas, (2, 10))
+ right_pane_canvas.blit(level_canvas, (2, 70))
def refresh_piece_preview_canvas():
@@ -301,7 +304,6 @@ def stick_piece():
if lines_burnt >= level * 10:
level += 1
- print("Level up to ", level)
current_piece, current_piece_position = next_piece, next_piece_position
next_piece, next_piece_position = generate_piece()
refresh_piece_preview_canvas()
@@ -328,6 +330,7 @@ right_pane_canvas.fill((255, 255, 255))
piece_preview_canvas = pygame.Surface((200, 200))
score_canvas = pygame.Surface((296, 50))
+level_canvas = pygame.Surface((296, 50))
grid = [[None for _ in range(10)] for _ in range(20)]
@@ -345,7 +348,6 @@ score = 0
clock = pygame.time.Clock()
-print("Level is ", level)
lines_burnt = 0
das = 0