adds game

This commit is contained in:
Rosia E Evans 2024-12-01 16:37:27 +00:00
parent 4496ba0811
commit 50e4712545
24 changed files with 528 additions and 0 deletions

33
input.py Normal file
View file

@ -0,0 +1,33 @@
import curses
from curses import *
class Input:
def __init__(self, scr):
self.scr = scr
halfdelay(10)
def wait_on_any_key(self) -> int:
try:
key_given = self.scr.getch()
return key_given
except curses.error:
pass
def wait_on_key(self, key):
try:
key_given = self.scr.getch()
if key_given is None:
return False
if key_given == ord(key):
return True
except curses.error:
pass
return False
def wait_indefinitely_for_key(self):
nocbreak()
self.scr.getch()
halfdelay(20)