aboutsummaryrefslogtreecommitdiff
path: root/turtetris_master/state_machine.py
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2017-07-20 13:32:37 +0200
committerKarel Kočí <karel.koci@nic.cz>2017-07-20 14:09:12 +0200
commitd776bc06babb22fbeb0a0ea513ab15163dcc9622 (patch)
treea9df6efa6b68fc8842690a2f000887f7109456d5 /turtetris_master/state_machine.py
parente51ab98da06992a2fb76bb9f6e54c59924b40ee5 (diff)
downloadturris-tetris-d776bc06babb22fbeb0a0ea513ab15163dcc9622.tar.gz
turris-tetris-d776bc06babb22fbeb0a0ea513ab15163dcc9622.tar.bz2
turris-tetris-d776bc06babb22fbeb0a0ea513ab15163dcc9622.zip
Make game area wider
Diffstat (limited to 'turtetris_master/state_machine.py')
-rw-r--r--turtetris_master/state_machine.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/turtetris_master/state_machine.py b/turtetris_master/state_machine.py
index 182ce7b..3c07acb 100644
--- a/turtetris_master/state_machine.py
+++ b/turtetris_master/state_machine.py
@@ -25,8 +25,13 @@ class StateMachine:
elif state == "game":
if self.state == "screen_checker" or self.state == "game-over":
self.game = Game(self.matrix)
+ elif self.state == "game-pause":
+ pass
else:
__exception__()
+ elif state == "game-pause":
+ if self.state != "game":
+ __exception__()
elif state == "game-over":
if self.state != "game":
__exception__()
@@ -45,8 +50,16 @@ class StateMachine:
else:
self.screen_checker.tick()
elif self.state == "game":
- if not self.game.tick(inpt):
+ if inpt['start']:
+ self.__update_state__('game-pause')
+ elif not self.game.tick(inpt):
self.__update_state__('game-over')
+ elif self.state == "game-pause":
+ if inpt['start']:
+ self.__update_state__('game')
+ elif inpt['select']:
+ self.game = Game(self.matrix)
+ self.__update_state__('game')
elif self.state == "game-over":
if inpt['start']:
self.__update_state__('game')