0% found this document useful (0 votes)
12 views1 page

Untitled Document

This document is a Python script that uses the Pygame library to create a simple window displaying the text 'Awesome Game!' on a black background. It initializes Pygame, sets up the screen dimensions and colors, and runs a main loop that allows the window to remain open until closed by the user. The script also includes font setup for rendering the text on the screen.

Uploaded by

30sam.wimmer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Untitled Document

This document is a Python script that uses the Pygame library to create a simple window displaying the text 'Awesome Game!' on a black background. It initializes Pygame, sets up the screen dimensions and colors, and runs a main loop that allows the window to remain open until closed by the user. The script also includes font setup for rendering the text on the screen.

Uploaded by

30sam.wimmer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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()

You might also like