def __init__(self, game): super().__init__(game=game, background_color=Palette.COLOR_9) title = Text(screen=self.game.screen, position=((self.x_middle),(40)), text='Selecione o tamanho do grafo', font_size=38, font_color=Palette.BLACK) back_button = Button(screen=self.game.screen, position=((self.game.WIDTH-120), (50)), on_press=lambda:game.change_screen(Menu), text='Voltar para o menu', color=Palette.RED) b_1 = Button(screen=self.game.screen, position=((self.x_middle-150), (200)), on_press=lambda:self.select(1), text='1', color=Palette.BLUE) b_2 = Button(screen=self.game.screen, position=((self.x_middle-150), (300)), on_press=lambda:self.select(2), text='2', color=Palette.BLUE) b_3 = Button(screen=self.game.screen, position=((self.x_middle-150), (400)), on_press=lambda:self.select(3), text='3', color=Palette.BLUE) b_4 = Button(screen=self.game.screen, position=((self.x_middle-150), (500)), on_press=lambda:self.select(4), text='4', color=Palette.BLUE) b_5 = Button(screen=self.game.screen, position=((self.x_middle-150), (600)), on_press=lambda:self.select(5), text='5', color=Palette.BLUE) b_6 = Button(screen=self.game.screen, position=((self.x_middle+150), (200)), on_press=lambda:self.select(6), text='6', color=Palette.BLUE) b_7 = Button(screen=self.game.screen, position=((self.x_middle+150), (300)), on_press=lambda:self.select(7), text='7', color=Palette.BLUE) b_8 = Button(screen=self.game.screen, position=((self.x_middle+150), (400)), on_press=lambda:self.select(8), text='8', color=Palette.BLUE) b_9 = Button(screen=self.game.screen, position=((self.x_middle+150), (500)), on_press=lambda:self.select(9), text='9', color=Palette.BLUE) b_10 = Button(screen=self.game.screen, position=((self.x_middle+150), (600)), on_press=lambda:self.select(10), text='10', color=Palette.BLUE) self.put_asset(title) self.put_asset(back_button) self.put_asset(b_1) self.put_asset(b_2) self.put_asset(b_3) self.put_asset(b_4) self.put_asset(b_5) self.put_asset(b_6) self.put_asset(b_7) self.put_asset(b_8) self.put_asset(b_9) self.put_asset(b_10)
def __init__(self, game): super().__init__(game=game, background_color=Palette.COLOR_9) #Assets quit_button = Button(screen=self.game.screen, position=((self.game.WIDTH-120), (50)), on_press=lambda:game.change_screen(Menu), text='Voltar para o menu', color=Palette.RED) next_button = Button(screen=self.game.screen, position=((self.x_middle), (self.game.HEIGHT-80)), on_press=self.game.next_question, text='Próxima pergunta', color=Palette.BLUE) self.correct_ans = Text(screen=self.game.screen, position=((220),(40)), font_size=28, font_color=Palette.GREEN) self.wrong_ans = Text(screen=self.game.screen, position=((220),(60)), font_size=28, font_color=Palette.RED) self.answer = Text(screen=self.game.screen, position=((self.x_middle),(60)), font_size=42) self.graph = Graph(game=self.game, reveal=True) self.put_asset(quit_button) self.put_asset(next_button) self.put_asset(self.correct_ans) self.put_asset(self.wrong_ans) self.put_asset(self.answer) self.put_asset(self.graph)
def __init__(self, game): super().__init__(game=game, background_color=Palette.COLOR_1) # Assets title = Text(screen=self.game.screen, position=((self.x_middle), (100)), text=self.game.GAME_NAME, font_size=60) sub_title = Text(screen=self.game.screen, position=((self.x_middle), (180)), text=self.game.INTRO_TEXT, font_size=34, font_color=Palette.COLOR_5) info_icon = pygame.image.load('info.png') info_button = Button(screen=self.game.screen, position=((70), (40)), on_press=lambda: game.change_screen(InfoScreen), icon=info_icon, text="Info", width=120, color=Palette.COLOR_1) play_button = Button(screen=game.screen, position=((self.x_middle), (game.HEIGHT - 100)), on_press=self.game.start_game, text='Jogar', width=300) self.img = Image(screen=game.screen, height=game.HEIGHT, width=game.WIDTH, src='assets/back.jpg') self.put_asset(self.img) definition_text = open('definition.txt').read() definition = Text(screen=self.game.screen, position=((self.x_middle), (self.y_middle - 150)), text=definition_text, font_size=24, font_type='robotoslab', font_color=Palette.WHITE) self.put_asset(definition) self.put_asset(title) self.put_asset(sub_title) #self.put_asset(info_button) self.put_asset(play_button)
def __init__(self, game): super().__init__(game=game, background_color=Palette.COLOR_9) # Assets self.timer = Timer(surface=self.game.screen, color=Palette.GREEN , rect=(20, 20, 60, 60) , start_angle=0 , stop_angle=2*math.pi, width=30, on_finished=lambda:self.game.no_answer_question()) yes_button = Button(screen=self.game.screen, position=((self.x_middle-120), (self.game.HEIGHT-80)), on_press=lambda:self.game.answer_question(True), text='Sim', color=Palette.BLUE) no_button = Button(screen=self.game.screen, position=((self.x_middle+120), (self.game.HEIGHT-80)), on_press=lambda:self.game.answer_question(False), text='Não', color=Palette.RED) question = Text(screen=self.game.screen, text='Esse grafo é bipartido?' ,position=((self.x_middle),(60)), font_size=30, font_color=Palette.COLOR_10) self.question_number = Text(screen=self.game.screen, position=((self.x_middle),(30)), font_size=30, font_color=Palette.COLOR_10) self.correct_ans = Text(screen=self.game.screen, position=((220),(40)), font_size=28, font_color=Palette.GREEN) self.wrong_ans = Text(screen=self.game.screen, position=((220),(60)), font_size=28, font_color=Palette.RED) self.graph = Graph(game=self.game, reveal=False) self.put_asset(self.timer) self.put_asset(yes_button) self.put_asset(no_button) self.put_asset(question) self.put_asset(self.question_number) self.put_asset(self.correct_ans) self.put_asset(self.wrong_ans) self.put_asset(self.graph)
def __init__(self, game): super().__init__(game=game, background_color=Palette.COLOR_9) title = Text(screen=self.game.screen, position=((self.x_middle),(40)), text='Criação do grafo', font_size=38, font_color=Palette.BLACK) back_button = Button(screen=self.game.screen, position=((self.game.WIDTH-120), (50)), on_press=lambda:game.change_screen(Menu), text='Voltar para o menu', color=Palette.RED) new_graph = Button(screen=self.game.screen, position=((self.x_middle-120), (self.game.HEIGHT-80)), on_press=self.create_new, text='Inserir novo grafo', color=Palette.BLUE) continue_button = Button(screen=self.game.screen, position=((self.x_middle+120), (self.game.HEIGHT-80)), on_press=self.play, text='Jogar Nível', color=Palette.RED) self.graph = Graph(game=self.game, graph=graph.Graph(self.graph_tam), editable=True, on_press=self.select_node) self.line = Line(screen=self.game.screen, mouse_guide=True, visible=False) self.put_asset(title) self.put_asset(self.line) self.put_asset(back_button) self.put_asset(self.graph) self.put_asset(new_graph) self.put_asset(continue_button)
def __init__(self, game): super().__init__(game=game, background_color=Palette.COLOR_9) # Assets self.timer = Timer(surface=self.game.screen, color=Palette.GREEN, rect=(20, 20, 60, 60), start_angle=0, stop_angle=2 * math.pi, width=30, on_finished=lambda: self.game.no_answer_question()) self.question_number = Text(screen=self.game.screen, position=((self.x_middle), (30)), font_size=30, font_color=Palette.COLOR_10) self.correct_ans = Text(screen=self.game.screen, position=((220), (40)), font_size=28, font_color=Palette.GREEN) self.wrong_ans = Text(screen=self.game.screen, position=((220), (60)), font_size=28, font_color=Palette.RED) question = Text(screen=self.game.screen, text='Aplique o algoritmo de kruskal.', position=((self.x_middle), (60)), font_size=30, font_color=Palette.COLOR_10) self.truck = Truck(screen=game.screen, position=(100, 240)) self.graph = Graph(game=self.game, reveal=False, truck=self.truck) self.put_asset(self.timer) self.put_asset(self.question_number) self.put_asset(self.correct_ans) self.put_asset(self.wrong_ans) self.put_asset(question) self.put_asset(self.graph) self.put_asset(self.truck)