Ejemplo n.º 1
0
 def draw_third_choice(self, player_ui, player_state):
     # player_state['cash'] += 1
     # player_state['heart'] -= 1
     # player_state['face'] = player_state['face']
     utils.draw_sprite(self.scenes[5])
     # player_ui.update(2)  # (player_state)
     # layer_ui.render()
     # sleep(0.5)
     return  # player_ui, player_state
Ejemplo n.º 2
0
 def draw_second_choice(self, player_ui: object, player_state: dict):
     # player_state['cash'] += 1
     # player_state['heart'] += 1
     # player_state['face'] = player_state['face']
     utils.draw_sprite(self.scenes[4])
     # player_ui.update(2)  # (player_state)
     # player_ui.render()
     # sleep(0.5)
     return  # player_ui, player_state
Ejemplo n.º 3
0
    def play(self, player_ui, player_state):

        screen = 0
        sleep(1)
        constants.SOUND_EVENT_DISAPPEAR.play()
        utils.draw_sprite(self.scenes[screen])
        sleep(1)
        player_ui.render()

        screen = 0
        one = constants.CAREER_EVENT_SEQUENCE_3_BUTTON_1
        two = constants.CAREER_EVENT_SEQUENCE_3_BUTTON_2
        three = constants.CAREER_EVENT_SEQUENCE_3_BUTTON_3
        four = constants.CAREER_EVENT_SEQUENCE_3_BUTTON_4

        while True:
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    pygame.quit()
                    quit()
                elif event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_ESCAPE:
                        pygame.quit()
                        quit()
                    if event.key in [pygame.K_DOWN]:
                        if screen == 3:
                            constants.SOUND_MENU_SELECTION.play()
                            one, two, three, four = two, three, four, one
                    if event.key in [pygame.K_UP]:
                        if screen == 3:
                            constants.SOUND_MENU_SELECTION.play()
                            one, two, three, four = four, one, two, three
                    if event.key == pygame.K_RETURN:
                        screen += 1
                        if screen != 3:
                            utils.draw_sprite(self.scenes[screen])
                            player_ui.render()
                        if screen == 5:
                            utils.draw_sprite(self.scenes[screen])
                            constants.SOUND_SAD_EVENT_APPEAR.play()
                            Meter().play_animation(1)
                            player_ui.update(2)
                            player_ui.render()
                        if screen == 6:
                            return player_state

                if screen == 3:
                    utils.draw_sprite(one)
                    player_ui.render()

            pygame.display.update()
            constants.CLK.tick(constants.FPS)
Ejemplo n.º 4
0
    def play(self, player_ui: object, player_state: dict):

        screen = 0
        sleep(1)
        constants.SOUND_EVENT_DISAPPEAR.play()
        utils.draw_sprite(self.scenes[screen])
        player_ui.update(2)  # (player_state)
        sleep(1)
        player_ui.render()

        while True:
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    pygame.quit()
                    quit()
                elif event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_ESCAPE:
                        pygame.quit()
                        quit()
                    elif event.key == pygame.K_RETURN:
                        if screen == 1:
                            player_state['cash'] -= 1
                            player_state['heart'] += 1
                            player_state['face'] -= 2
                            # utils.draw_sprite(self.scenes[screen])
                            constants.SOUND_HAPPY_EVENT_APPEAR.play()
                            Meter().play_animation(2)
                            player_ui.update(3)  # (player_state)
                            player_ui.render()
                        if screen == 2:
                            return player_state
                        screen += 1
                        utils.draw_sprite(self.scenes[screen])
                        # player_ui.update(player_state)
                        player_ui.render()

            pygame.display.update()
            constants.CLK.tick(constants.FPS)
Ejemplo n.º 5
0
 def play_animation(self, number):
     if number == 0:
         utils.play_animation(0.05, self.animation_sequence_0)
         utils.draw_sprite(self.animation_sequence_0[-1])
     if number == 1:
         utils.play_animation(0.05, self.animation_sequence_1)
         utils.draw_sprite(self.animation_sequence_1[-1])
     if number == 2:
         utils.play_animation(0.05, self.animation_sequence_2)
         utils.draw_sprite(self.animation_sequence_2[-1])