@oledjigames

Python str в классе не меняется, что не так?

Когда происходит self.choice_var = ('yes') или ('no') но choice_1 не меняется на ('yes') или ('no') а остается изначальным choice_1 = yes почему?
Код:
choice_1 = 'yes'
class choice:
    def __init__(self,level_num, text1, text2, choice_var, background, player, player_x, player1, player1_x):
         self.level_num = level_num
         self.text1 = text1
         self.text2 = text2
         self.choice_var = choice_var
         self.background = background
         self.player = player
         self.player_x = player_x
         self.player1 = player1
         self.player1_x = player1_x
         self.show()
    def show(self):
        if level_selected==(self.level_num):
            screen.blit(self.background,(0, 0))
            screen.blit(self.player, (self.player_x, 0))
            screen.blit(self.player1, (self.player1_x, 0))
            screen.blit(choice_pic,(0, 0))
            if mousey<=(295):
                text_choice_1 = font1.render(self.text1, 1, YELLOW)
                text_choice_2 = font1.render(self.text2, 1, WHITE)
                self.choice_var = ('yes')
            elif mousey>=(295):
                text_choice_2 = font1.render(self.text2, 1, YELLOW)
                text_choice_1 = font1.render(self.text1, 1, WHITE)
                self.choice_var = ('no')
            screen.blit(text_choice_1,(452, 233))
            screen.blit(text_choice_2,(452, 320))
            pygame.display.update()
        pass

в цикле:
dialog1 = choice(9, "yesyesyesyesyesyesyes", "no", choice_1, background2, player0, 120, player1, -120)
    dialog1.show()
  • Вопрос задан
  • 87 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы