pygame template

Solutions on MaxInterview for pygame template by the best coders in the world

showing results for - "pygame template"
Karl
02 Apr 2018
1import pygame,sys
2
3#game initialization
4pygame.init()
5window = pygame.display.set_mode((900,600),0,32)
6pygame.display.set_caption('Basic Pygame Template')
7clock = pygame.time.Clock()
8
9#game loop
10while True:
11    for event in pygame.event.get():
12        if event.type == pygame.QUIT:
13            pygame.quit()
14            sys.exit()
15    #game code here
16    
17    pygame.display.update()
18    clock.tick(60)
19