X-Git-Url: https://git.ctpug.org.za/?a=blobdiff_plain;f=koperkapel%2Fgamelib%2Fkeypad.py;h=c7961dbc3484e6af5900523e6e290be2ddd9195c;hb=5cd50a8c6ecf77a17eab6dcda0425501772caaaf;hp=bf9e084e0d23319d841a27088656f72b34ff4cb9;hpb=57cda86d1aa60e04e3dd7567439cd79cd95f3e1a;p=koperkapel.git diff --git a/koperkapel/gamelib/keypad.py b/koperkapel/gamelib/keypad.py index bf9e084..c7961db 100644 --- a/koperkapel/gamelib/keypad.py +++ b/koperkapel/gamelib/keypad.py @@ -2,8 +2,8 @@ import os from pgzero.loaders import images +from pgzero.ptext import getsurf from ..actors.orientatedsurf import SurfActor -from ..constants import TILE_SIZE class Keypad(SurfActor): @@ -12,8 +12,12 @@ 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() + ocolor = (96, 96, 128, 255) + surf.blit(getsurf( + str(required_smart), owidth=2, + ocolor=ocolor, color="black"), (0, 0)) + super().__init__(surf, anchor=(1, 1)) def activate(self, smart): if smart >= self.required_smart: