aboutsummaryrefslogtreecommitdiff
path: root/turtetris_master/game.py
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2017-07-20 14:17:28 +0200
committerKarel Kočí <karel.koci@nic.cz>2017-07-20 14:53:28 +0200
commit580130d99c798c9fb0034f4daba96f8357927f40 (patch)
tree906c7e1d7053e47148b35106c9f6577dd304949e /turtetris_master/game.py
parentd776bc06babb22fbeb0a0ea513ab15163dcc9622 (diff)
downloadturris-tetris-580130d99c798c9fb0034f4daba96f8357927f40.tar.gz
turris-tetris-580130d99c798c9fb0034f4daba96f8357927f40.tar.bz2
turris-tetris-580130d99c798c9fb0034f4daba96f8357927f40.zip
Add score
Diffstat (limited to 'turtetris_master/game.py')
-rw-r--r--turtetris_master/game.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/turtetris_master/game.py b/turtetris_master/game.py
index 63987b0..3a5d463 100644
--- a/turtetris_master/game.py
+++ b/turtetris_master/game.py
@@ -120,7 +120,12 @@ class Game:
def __show_score__(self):
"Show score in bottom right"
- pass
+ i = self.score % 5
+ y = int(self.score / 5)
+ for ii in range(i):
+ self.matrix.pixel(self.matrix.width - 1, ii, 'green')
+ for yy in range(y):
+ self.matrix.pixel(self.matrix.width - 2, yy, 'green')
def __place__(self):
"Stone can't move so place it, check lines and generate new one"
@@ -202,8 +207,7 @@ class Game:
self.__rotate__()
if input['left'] != input['right']:
self.__move__(input['left'])
- if self.step >= self.step_edge or \
- (input['down'] and self.step >= self.step_edge/3):
+ if self.step >= self.step_edge or input['down']:
gameover = not self.__down__()
self.step = 0
else: