From 89e09de5e12744f9435b6f31fa2e9f7116fc6347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 19 Jul 2017 14:58:24 +0200 Subject: Add statemachine and empty game class --- turtetris_master/__init__.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'turtetris_master/__init__.py') diff --git a/turtetris_master/__init__.py b/turtetris_master/__init__.py index e7f9fab..b389525 100644 --- a/turtetris_master/__init__.py +++ b/turtetris_master/__init__.py @@ -1,23 +1,17 @@ import time from .led_output import Matrix from .usb_input import Gamepad -from .screen_checker import ScreenChecker +from .state_machine import StateMachine def main(): "Main function" inpt = Gamepad() mtrx = Matrix() - sc = ScreenChecker(mtrx) - mtrx.display() # Display first state + sm = StateMachine(mtrx, inpt) while True: tstart = time.time() - ## - #print(inpt.check()) - if sc.tick(): - mtrx.display() - #print(mtrx.__mat__[2]) - ## + sm.tick() trest = (1/60) - (time.time() - tstart) if trest > 0: time.sleep(trest) -- cgit v1.2.3