from player import Player import pygame import sys from menu import Menu # MenĂ¼ importieren import settings from world import World def main(): pygame.init() screen = pygame.display.set_mode((settings.SCREEN_WIDTH, settings.SCREEN_HEIGHT)) pygame.display.set_caption("The Last Ollie - A Fred Story") clock = pygame.time.Clock() menu = Menu(screen) world = World(screen) current_scene = settings.START_POINT running = True while running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False if current_scene == "menu": menu.handle_event(event) if menu.ready_to_start_game: menu.ready_to_start_game = False # Reset! current_scene = "world" if current_scene == "world": result = world.handle_event(event) if result == "menu": current_scene = "menu" menu.input_active = False menu.show_main_buttons = True menu.ready_to_start_game = False if current_scene == "menu": menu.draw() elif current_scene == "world": world.player.update(670) world.draw() pygame.display.flip() clock.tick(60) pygame.quit() sys.exit() if __name__ == "__main__": main()