This commit is contained in:
cubernetes 2023-08-11 02:52:14 +02:00
parent 15b53cd262
commit aa2e9b27e1
3 changed files with 4 additions and 7 deletions

Binary file not shown.

7
start.py → master.py Normal file → Executable file
View File

@ -7,15 +7,12 @@ from typing import NoReturn
from utils import *
def start_game() -> int:
proc = Popen(['./game.py'])
proc = Popen(['./start_game.sh'])
proc.communicate()
return proc.returncode
def main() -> NoReturn:
if len(sys.argv) != 2:
print(f'Usage: {sys.argv[0]} TERMINAL_DEVICE')
sys.exit(1)
show_matrix(sys.argv[1])
show_matrix()
while True:
if found_hands():
start_game()

View File

@ -41,8 +41,8 @@ def collect_sfx() -> None:
def start_sfx() -> None:
Popen(['paplay', './assets/sfx/start.mp3'])
def show_matrix(term_dev: str) -> None:
Popen(['sh', '-c', '2>/dev/null tmatrix 1>"' + term_dev + '"'])
def show_matrix() -> None:
Popen(['tmatrix'])
def found_hands() -> bool:
capture: VideoCapture = cv2.VideoCapture(0)