Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to make a screen in pygame

#bringing pygame into python as a module
import pygame
#allowing pygame to work its magic
pygame.init()
#this sets the size of the screen you want
screen = pygame.display.set_mode((800, 800))


#this is a while loop that allows you to close the window when the x is pressed
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
 
PREVIOUS NEXT
Tagged: #screen #pygame
ADD COMMENT
Topic
Name
5+7 =