Beispiel #1
0
def main():
    game = DrawGame()
    done = False
    attr_rects = []
    player = Person(Attributes)
    while not done:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                done = True
            if event.type == pygame.MOUSEBUTTONUP:
                pos = pygame.mouse.get_pos()
                clicked_attrs = [s for s in attr_rects if s.collidepoint(pos)]
                for cc in clicked_attrs:
                    player.apply_activity(activities()[cc.label]())
        attr_rects = game.draw_game(player)
        game.clock.tick(60)