smartness indicator on keypads
authoradrianna <adrianna.pinska@gmail.com>
Sat, 5 Mar 2016 23:06:02 +0000 (01:06 +0200)
committeradrianna <adrianna.pinska@gmail.com>
Sat, 5 Mar 2016 23:06:13 +0000 (01:06 +0200)
koperkapel/gamelib/keypad.py

index bf9e084e0d23319d841a27088656f72b34ff4cb9..5658db4d6253a04baa3db42f298ab04037e3fdff 100644 (file)
@@ -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: