From 45c1a937e42bee999d7dc8b07743d09878436e92 Mon Sep 17 00:00:00 2001 From: Michael Pilosov Date: Thu, 9 May 2024 17:37:28 -0600 Subject: [PATCH] ncurses tetris --- requirements.txt | 4 ++++ tetris.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index b26e81f..ee67824 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,6 @@ numpy +# Optional Dependencies +# For Windows users needing ncurses support: +# windows-curses; sys_platform == 'win32' + diff --git a/tetris.py b/tetris.py index 4f4bb23..6429fc0 100644 --- a/tetris.py +++ b/tetris.py @@ -111,7 +111,7 @@ def main(stdscr): # Handle key inputs key = stdscr.getch() - if key == ord("q"): + if key == ord("Q"): break elif ( key == ord("a") @@ -143,7 +143,7 @@ def main(stdscr): board = clear_rows(board) current_piece = PIECES[np.random.choice(piece_types)] i, j = START_POS - elif key == ord("g"): + elif key == ord("G"): auto_gravity = not auto_gravity # Gravity effect