aboutsummaryrefslogtreecommitdiff
path: root/turtetris_master/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'turtetris_master/__init__.py')
-rw-r--r--turtetris_master/__init__.py12
1 files changed, 3 insertions, 9 deletions
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)