1 # A doors / keypads set
4 from pgzero.loaders import images
5 from pgzero.ptext import getsurf
6 from ..actors.orientatedsurf import SurfActor
9 class Keypad(SurfActor):
11 def __init__(self, x, y, doors, required_smart=0):
13 self.game_pos = (x, y)
14 self.required_smart = required_smart
15 surf = images.load(os.path.join('fixtures', 'keypad')).copy()
16 ocolor = (96, 96, 128, 255)
18 str(required_smart), owidth=2,
19 ocolor=ocolor, color="black"), (0, 0))
20 super().__init__(surf, anchor=(1, 1))
22 def activate(self, smart):
23 if smart >= self.required_smart:
24 for door in self._doors:
30 print("You are not smart enough for this keypad.")