# Importing the necessary modules import pygame # Module for game development import sys # Module providing access to some variables used or maintained by the Python interpreter and to functions that interact strongly with the interpreter # Initializing the pygame module pygame.init() # Creating a display surface with specified dimensions screen = pygame.display.set_mode((400, 400)) # Creating a pygame Clock object to manage time clock = pygame.time.Clock() # Creating font objects for dialogue, name, and game over text dialogue_font = pygame.font.SysFont('arial', 15) name_font = pygame.font.SysFont('Helvetica', 20) game_over_font = pygame.font.SysFont('Verdana', 60) # Defining colors color_blue = (0, 0, 255) color_red = (255, 0, 0) color_white = (255, 255, 255) # Rendering text surfaces with specified text, anti-aliasing, and colors dialogue = dialogue_font.render("Life Before Death, Strength Before Weakness, Journey Before Destination", True, (0, 0, 0)) name = name_font.render("Kaladin Stormblessed", True, (color_blue)) game_over = game_over_font.render("Game Over", True, (color_red)) # Main game loop while True: for event in pygame.event.get(): # Checking for quit event if event.type == pygame.QUIT: pygame.quit() # Quits the pygame module sys.exit() # Exits the Python program # Filling the screen with white color screen.fill((color_white)) # Blitting (rendering) the text surfaces onto the screen at specified positions screen.blit(dialogue, (40, 40)) screen.blit(name, (40, 140)) screen.blit(game_over, (40, 240)) # Updating the display pygame.display.flip() # Limiting the frame rate to 60 frames per second clock.tick(60)