Esempio n. 1
0
    def create_button(self, button, x, y, action=None):
        load_button_active = pygame.image.load(button_list[button][0])
        load_button_inactive = pygame.image.load(button_list[button][1])
        mouse = pygame.mouse.get_pos()
        click = pygame.mouse.get_pressed()
        # print(click)
        if load_button_inactive.get_rect(left=x, top=y).collidepoint(mouse):
            self.screen.blit(load_button_active, (x, y))
            if click[0] == 1 and action != None:
                if action == "next":
                    self.scene_on = True
                elif action == "quit":
                    pygame.quit()
                    quit()
                if action == "library":
                    moving_scene['library'] = True
                elif action == "bedroom":
                    moving_scene['bedroom'] = True
                elif action == "kitchen":
                    moving_scene['kitchen'] = True
                elif action == "final":
                    moving_scene['final'] = True
                elif action == 'note1':
                    puzzle = Library_puzzle()
                    puzzle.puzzle1(None)
                elif action == 'note2':
                    puzzle = Library_puzzle()
                    puzzle.puzzle2(None)
                elif action == 'watch':
                    puzzle = Bedroom_Puzzle()
                    puzzle.puzzle1()
                elif action == 'picture':
                    puzzle = Bedroom_Puzzle()
                    puzzle.puzzle2()
                elif action == 'phone':
                    puzzle = Kitchen_Puzzle()
                    puzzle.puzzle1()
                elif action == 'locket':
                    puzzle = Kitchen_Puzzle()
                    puzzle.puzzle2()

        else:
            self.screen.blit(load_button_inactive, (x, y))
Esempio n. 2
0
 def second_puzzle(self, user_input):
     current_puzzle = Bedroom_Puzzle()
     puzzle_solved = current_puzzle.puzzle2()
     if puzzle_solved:
         player_list.append(master_list[5])
Esempio n. 3
0
 def first_puzzle(self, user_input):
     current_puzzle = Bedroom_Puzzle()
     puzzle_solved = current_puzzle.puzzle1()
     if puzzle_solved:
         player_list.append(master_list[4])