pygame-skeleton

Here is some minimal code to start a pygame project:

    
import pygame
pygame.init()

screen = pygame.display.set_mode((640, 480))


running = True
while running:
current_time = pygame.time.get_ticks()

for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.quit()

screen.fill(pygame.Color("black"))

pygame.display.flip()
    

edit this page