Answers for "how to open a pygame window"

7

how to create a pygame window

import pygame
pygame.init()
back = (192,192,192)
gameDisplay = pygame.display.set_mode((800,600))
pygame.display.set_caption('A bit Racey')
gameDisplay.fill(back)
clock = pygame.time.Clock()
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    pygame.display.update()
    clock.tick(60)   
pygame.quit()
quit()
Posted by: Guest on October-09-2020
1

pygame window

import pygame
pygame.init()
screen = pygame.display.set_mode((800,600))
pygame.display.set_caption('A bit Racey')
clock = pygame.time.Clock()
running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
    pygame.display.update()
    clock.tick(80)   
pygame.quit()
quit()
Posted by: Guest on August-06-2021
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