import pygame # Import the pygame library
pygame.init() # Initialize pygame
# Screen dimensions
X = 400
Y = 400
# Colors
white = [255, 255, 255]
black = [0, 0, 0]
# Set up the screen
DISPLAY = pygame.display.set_mode([X, Y])
pygame.display.set_caption('Text Practice')
# Font setup
font = pygame.font.Font(None, 24)
# Main game loop
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT: # Allow the game to close
running = False
DISPLAY.fill(black) # Set the background color to black
# Render the text
text = font.render("Awesome Game!", True, white)
# Display the text at (200, 200)
DISPLAY.blit(text, [200, 200])
# Update the display
pygame.display.flip()
# Quit pygame
pygame.quit()