Answers for "basic window template pygame"

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
0

how to make window pygame

import pygame

pygame.init()

win = pygame.display.set_mode((800,600))
pygame.display.set_caption('A bit Racey')
win.fill(255,255,255)
Posted by: Guest on July-08-2021

Python Answers by Framework

Browse Popular Code Answers by Language