diff options
author | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-12-22 19:35:06 +0100 |
---|---|---|
committer | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-12-22 20:10:31 +0100 |
commit | 73a2e406302fc863d0d62926a2c451238c863c77 (patch) | |
tree | 98c919d7c7f409da76dfe283680a399d82a3e430 /cameltris.py | |
parent | 751a2ce6d3bc98e95de40cafcb48b7626e4aeeaf (diff) |
Associate the level to the fall speed
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'cameltris.py')
-rwxr-xr-x | cameltris.py | 6 |
1 files changed, 4 insertions, 2 deletions
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() |