1 # A doors / keypads set
4 from pgzero.loaders import images
5 from pgzero.ptext import getsurf
6 from ..actors.orientatedsurf import SurfActor
7 from ..constants import TILE_SIZE
8 from ..serums import SERUM_OVERLAY_COLORS
11 class Keypad(SurfActor):
13 def __init__(self, x, y, doors, required_smart=0):
15 self.game_pos = (x, y)
16 self.required_smart = required_smart
17 surf = images.load(os.path.join('fixtures', 'keypad')).copy()
18 surf.blit(getsurf(str(required_smart), owidth=2, ocolor=SERUM_OVERLAY_COLORS["smart"], color="black"), (0, 0))
19 super().__init__(surf, anchor=(1, 1))
21 def activate(self, smart):
22 if smart >= self.required_smart:
23 for door in self._doors:
29 print("You are not smart enough for this keypad.")