Esempio n. 1
0
 def response_event(self, event):
     super(Choicebox, self).response_event(event)
     if event.type == pygame.KEYDOWN:
         m = self.keydict.get(event.key)
         if m is not None:
             getattr(get_game().player, m)()
         self.closed = True
Esempio n. 2
0
 def __init__(self, location=(0, 0), surface=None):
     Dialog.__init__(self, (0, 0, 640, 640), (200, 200, 200),
                     surface,
                     closekey=pygame.K_ESCAPE,
                     border_width=0,
                     shadow_weight=0)
     self.font = pygame.font.Font(None, 30)
     self.player = get_game().player
     self.x, self.y = location
Esempio n. 3
0
 def response_event(self, event):
     super(Choicebox, self).response_event(event)
     if event.type == pygame.KEYDOWN:
         m = self.keydict.get(event.key)
         if m is not None:
             if hasattr(self, m):
                 getattr(self, m)()
             else:
                 getattr(get_game().player, m)()
Esempio n. 4
0
 def show(self):
     clock = pygame.time.Clock()
     while not self.closed:
         clock.tick(get_game().fps)
         for event in pygame.event.get():
             if event.type == pygame.KEYDOWN and event.key == self.closekey:
                 self.closed = True
             self.response_event(event)
         get_game().bgmusic()
         get_game().animate()
         get_game().draw()
         self.draw()
         pygame.display.update()
Esempio n. 5
0
 def show(self):
     clock = pygame.time.Clock()
     while not self.closed:
         clock.tick(get_game().fps)
         for event in pygame.event.get():
             if event.type == pygame.QUIT:
                 sys.exit()
             elif event.type == pygame.KEYDOWN and event.key == self.closekey:
                 self.closed = True
             self.response_event(event)
         get_game().bgmusic()
         get_game().animate()
         get_game().draw()
         self.draw()
         pygame.display.update()
Esempio n. 6
0
 def __init__(self, location=(0, 0), surface=None):
     Dialog.__init__(self, (0, 0, 640, 640), (200, 200, 200), surface, closekey=pygame.K_ESCAPE, border_width=0, shadow_weight=0)
     self.font = pygame.font.Font(None, 30)
     self.player = get_game().player
     self.x, self.y = location