diff options
author | Karel Kočí <karel.koci@nic.cz> | 2017-07-20 14:17:28 +0200 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2017-07-20 14:53:28 +0200 |
commit | 580130d99c798c9fb0034f4daba96f8357927f40 (patch) | |
tree | 906c7e1d7053e47148b35106c9f6577dd304949e /turtetris_master/state_machine.py | |
parent | d776bc06babb22fbeb0a0ea513ab15163dcc9622 (diff) | |
download | turris-tetris-580130d99c798c9fb0034f4daba96f8357927f40.tar.gz turris-tetris-580130d99c798c9fb0034f4daba96f8357927f40.tar.bz2 turris-tetris-580130d99c798c9fb0034f4daba96f8357927f40.zip |
Add score
Diffstat (limited to 'turtetris_master/state_machine.py')
-rw-r--r-- | turtetris_master/state_machine.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/turtetris_master/state_machine.py b/turtetris_master/state_machine.py index 3c07acb..7cbfcaa 100644 --- a/turtetris_master/state_machine.py +++ b/turtetris_master/state_machine.py @@ -36,6 +36,14 @@ class StateMachine: if self.state != "game": __exception__() self.matrix.fill('red') + i = self.matrix.height - 2 + # Show score + for _ in range(int(self.game.score / 5)): + for s in range(5): + self.matrix.pixel(s + 3, i, 'green') + i -= 1 + for s in range(self.game.score % 5): + self.matrix.pixel(s + 3, i, 'green') self.matrix.display() else: __exception__() |