1import pygame
2pygame.init()
3back = (192,192,192)
4gameDisplay = pygame.display.set_mode((800,600))
5pygame.display.set_caption('A bit Racey')
6gameDisplay.fill(back)
7clock = pygame.time.Clock()
8running = True
9while running:
10 for event in pygame.event.get():
11 if event.type == pygame.QUIT:
12 running = False
13 pygame.display.update()
14 clock.tick(60)
15pygame.quit()
16quit()
17
18
1import pygame
2pygame.init() #initialize pygame
3SCREEN_WIDTH = 600 # width (in px)
4SCREEN_HEIGHT = 800 # height (in px)
5
6WIN = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) # creates a screen of 600px X 800px
7
8while True:
9 pygame.display.update() # updates the screen
1import pygame
2pygame.init()
3screen = pygame.display.set_mode((800,600))
4pygame.display.set_caption('A bit Racey')
5clock = pygame.time.Clock()
6running = True
7while running:
8 for event in pygame.event.get():
9 if event.type == pygame.QUIT:
10 running = False
11 pygame.display.update()
12 clock.tick(80)
13pygame.quit()
14quit()