From be83859173f4f130cdf2919df09344249b1091a4 Mon Sep 17 00:00:00 2001 From: adrianna Date: Sun, 6 Mar 2016 01:06:02 +0200 Subject: [PATCH] smartness indicator on keypads --- koperkapel/gamelib/keypad.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/koperkapel/gamelib/keypad.py b/koperkapel/gamelib/keypad.py index bf9e084..5658db4 100644 --- a/koperkapel/gamelib/keypad.py +++ b/koperkapel/gamelib/keypad.py @@ -2,8 +2,10 @@ import os from pgzero.loaders import images +from pgzero.ptext import getsurf from ..actors.orientatedsurf import SurfActor from ..constants import TILE_SIZE +from ..serums import SERUM_OVERLAY_COLORS class Keypad(SurfActor): @@ -12,8 +14,9 @@ class Keypad(SurfActor): self._doors = doors self.game_pos = (x, y) self.required_smart = required_smart - surf = images.load(os.path.join('fixtures', 'keypad')) - super().__init__(surf, anchor=(0, 0)) + surf = images.load(os.path.join('fixtures', 'keypad')).copy() + surf.blit(getsurf(str(required_smart), owidth=2, ocolor=SERUM_OVERLAY_COLORS["smart"], color="black"), (0, 0)) + super().__init__(surf, anchor=(1, 1)) def activate(self, smart): if smart >= self.required_smart: -- 2.34.1