From 73a2e406302fc863d0d62926a2c451238c863c77 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Tue, 22 Dec 2020 19:35:06 +0100 Subject: Associate the level to the fall speed Signed-off-by: Olivier Gayot --- cameltris.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cameltris.py') diff --git a/cameltris.py b/cameltris.py index dc83ea8..ca4ffed 100755 --- a/cameltris.py +++ b/cameltris.py @@ -299,9 +299,11 @@ next_piece, next_piece_position = generate_piece() refresh_piece_preview_canvas() # Number of frames -frames_per_gridcell = 3 +frames_per_gridcell = [48, 43, 38, 33, 28, 23, 18, 13, 8, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1] piece_drop_frames = 0 +level = 16 + pygame.key.set_repeat(200, 50) clock = pygame.time.Clock() @@ -333,7 +335,7 @@ while True: except WouldCollide: stick_piece() - if piece_drop_frames >= frames_per_gridcell: + if piece_drop_frames >= frames_per_gridcell[level - 1]: piece_drop_frames = 0 try: move_piece_down() -- cgit v1.2.3