import pygame from titlescreen import title_screen from lobby import level_selector from displaymenu import display_menu from level1 import level_1 from level2 import level_2 from level3 import level_3 # Initialize Pygame pygame.init() # Set up screen dimensions screen_width = 800 screen_height = 800 screen = pygame.display.set_mode((screen_width, screen_height)) pygame.display.set_caption("Tauranga Boys' College THE GAME") # Initialize level_end level_end = 0 def main_game(): global level_end scene_name = "titlescreen" while scene_name != "quit": # Print the value of level_end print("Current level_end:", level_end) # Scene if scene_name == "titlescreen": scene_name = title_screen(screen_height, screen_width, screen, level_end) if scene_name == "level_selector": scene_name = level_selector(screen_height, screen_width, screen) if scene_name == "display_menu": scene_name = display_menu(screen) if scene_name == "level_1" and level_end >= 0: scene_name = level_1(screen_height, screen_width, screen) # Update level_end based on level_1 if scene_name == "level_2" and level_end >= 1: scene_name = level_2(screen_height, screen_width, screen) # Update level_end based on level_2 if scene_name == "level_3" and level_end >= 2: scene_name = level_3(screen_height, screen_width, screen) # Update level_end based on level_3 # Start the game main_game()