From d776bc06babb22fbeb0a0ea513ab15163dcc9622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 20 Jul 2017 13:32:37 +0200 Subject: Make game area wider --- turtetris_master/state_machine.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'turtetris_master/state_machine.py') 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') -- cgit v1.2.3