From: adrianna Date: Sat, 5 Mar 2016 23:06:02 +0000 (+0200) Subject: smartness indicator on keypads X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=be83859173f4f130cdf2919df09344249b1091a4;p=koperkapel.git smartness indicator on keypads --- 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: