From 580130d99c798c9fb0034f4daba96f8357927f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 20 Jul 2017 14:17:28 +0200 Subject: Add score --- turtetris_master/state_machine.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'turtetris_master/state_machine.py') 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__() -- cgit v1.2.3