aboutsummaryrefslogtreecommitdiff
path: root/turtetris_master/__init__.py
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2017-07-19 14:58:24 +0200
committerKarel Kočí <karel.koci@nic.cz>2017-07-19 15:05:43 +0200
commit89e09de5e12744f9435b6f31fa2e9f7116fc6347 (patch)
tree46c91fa193478a3b935110caeabd50ea42a9dd26 /turtetris_master/__init__.py
parentb934596cfd5415ce83b5a7b42120e0f0e229937a (diff)
downloadturris-tetris-89e09de5e12744f9435b6f31fa2e9f7116fc6347.tar.gz
turris-tetris-89e09de5e12744f9435b6f31fa2e9f7116fc6347.tar.bz2
turris-tetris-89e09de5e12744f9435b6f31fa2e9f7116fc6347.zip
Add statemachine and empty game class
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)