def handle_mouse_button(self, button): mx, my = pg.mouse.get_pos() quit_button_rect = pg.Rect(650, 30, 140, 40) if button == 1: if quit_button_rect.collidepoint((mx, my)): main() return self
def handle_mouse_button(self, button): city = choice(get_cities()) city2 = choice(get_cities()) mx, my = pg.mouse.get_pos() battle_button_rect = pg.Rect(285, 245, 225, 70) quit_button_rect = pg.Rect(650, 30, 140, 40) choose_city_button_rect = pg.Rect(285, 400, 225, 70) if button == 1: if quit_button_rect.collidepoint((mx, my)): main() if choose_city_button_rect.collidepoint((mx, my)): city = MoodScreen() return city if battle_button_rect.collidepoint((mx, my)): if self.gunnar_mood_score == 0: if self.popup_state == "not clicked": self.gunnar_mood_score = calc_mood_score(gunnar.mood, city, live=False) gunnar.add_health(self.gunnar_mood_score) gunnar.add_max_health(self.gunnar_mood_score) self.ada_mood_score = calc_mood_score(ada.mood, city2, live=False) ada.add_health(self.ada_mood_score) ada.add_max_health(self.ada_mood_score) self.popup_state = "one click" show_city_score(city, city2) music_battle() return BattleScreen() return self
def handle_mouse_button(self, button): mx, my = pg.mouse.get_pos() back_button_rect = pg.Rect(30, 540, 140, 40) quit_button_rect = pg.Rect(650, 30, 140, 40) if button == 1: if back_button_rect.collidepoint((mx, my)): return MenuStartScreen() if quit_button_rect.collidepoint((mx, my)): main()
def handle_mouse_button(self, button): mx, my = pg.mouse.get_pos() quit_button_rect = pg.Rect(650, 30, 140, 40) #back_button_rect = pg.Rect(30, 540, 140, 40) if button == 1: # if back_button_rect.collidepoint((mx, my)): # return BattleScreen() if quit_button_rect.collidepoint((mx, my)): main() return self
def handle_mouse_button(self, button): mx, my = pg.mouse.get_pos() start_game_button_rect = pg.Rect(275, 280, 240, 65) instructions_button_rect = pg.Rect(275, 360, 240, 65) quit_game_button_rect = pg.Rect(275, 440, 240, 65) if button == 1: if start_game_button_rect.collidepoint((mx, my)): return StartScreen() if instructions_button_rect.collidepoint((mx, my)): return InstructionsScreen() if quit_game_button_rect.collidepoint((mx, my)): main()
def handle_mouse_button(self, button): mx, my = pg.mouse.get_pos() quit_button_rect = pg.Rect(650, 30, 140, 40) attack_button_rect = pg.Rect(57, 430, 150, 50) block_button_rect = pg.Rect(222, 430, 150, 50) sp_attack_button_rect = pg.Rect(390, 430, 150, 50) quiz_button_rect = pg.Rect(563, 430, 150, 50) if button == 1: if quit_button_rect.collidepoint((mx, my)): main() if block_button_rect.collidepoint((mx, my)): return BlockScreen("user") if attack_button_rect.collidepoint((mx, my)): return AttackScreen("user", self.is_block) if sp_attack_button_rect.collidepoint((mx, my)): return SpecialAttackScreen("user", self.is_block) if quiz_button_rect.collidepoint((mx, my)): global_stuff.next_screen = QuizStartScreen( 5, quiz_categories, self, gunnar) return self