Answers for "pygame basic setup template"

5

pygame template

import pygame,sys

#game initialization
pygame.init()
window = pygame.display.set_mode((900,600),0,32)
pygame.display.set_caption('Basic Pygame Template')
clock = pygame.time.Clock()

#game loop
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()
    #game code here
    
    pygame.display.update()
    clock.tick(60)
Posted by: Guest on April-09-2020

Python Answers by Framework

Browse Popular Code Answers by Language