if event.type == pygame.MOUSEBUTTONDOWN: if not main_menu.is_started and not main_menu.is_shopped and not main_menu.in_garage and not main_menu.in_settings: main_menu.check_mouse_down(event.pos) if main_menu.is_shopped: shop.check_mouse_down(event.pos) if main_menu.in_garage: garage.check_mouse_down(event.pos) if main_menu.in_roads: road_select.check_mouse_down(event.pos) if main_menu.in_settings: settings.check_mouse_down(event.pos) if event.type == pygame.MOUSEBUTTONUP: if not main_menu.is_started and not main_menu.is_shopped and not main_menu.in_garage and not main_menu.in_settings: main_menu.check_mouse_up() if main_menu.is_shopped: shop.check_mouse_up() if main_menu.in_garage: garage.check_mouse_up() if main_menu.in_roads: road_select.check_mouse_up() if main_menu.in_settings: settings.check_mouse_up() if not main_menu.is_started and not main_menu.is_shopped and not main_menu.in_garage and not main_menu.in_roads: main_menu.render() if change_road: game.road.image = pygame.transform.scale( pygame.image.load(path + f'{choose_roads()}.png'), (800, 800)) change_road = False if main_menu.is_shopped and not main_menu.is_started and not main_menu.in_garage and not main_menu.in_roads and not main_menu.in_settings: screen.fill('#c0c0c0')