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()
1import pygame
2pygame.init()
3
4"""this is how to make a pygame window, the 500,500 is the size of the window
5btw(it is your choice what the size is ) """
6
7var = pygame.display.set_mode((500,500))
8
9"""this is how to change the title of the window"""
10pygame.display.set_caption('example')
11
1import pygame
2
3pygame.init()
4
5win = pygame.display.set_mode((800,600))
6pygame.display.set_caption('A bit Racey')
7win.fill(255,255,255)