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
2background_colour = (255,255,255)
3(width, height) = (300, 200)
4screen = pygame.display.set_mode((width, height))
5pygame.display.set_caption('Tutorial 1')
6screen.fill(background_colour)
7pygame.display.flip()
8running = True
9while running:
10 for event in pygame.event.get():
11 if event.type == pygame.QUIT:
12 running = False
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
3# The background color can be whatever you want
4background_colour = (255,255,255)
5(width, height) = (300, 200)
6screen = pygame.display.set_mode((width, height))
7pygame.display.set_caption('Tutorial 1')
8screen.fill(background_colour)
9pygame.display.flip()
10running = True
11while running:
12 for event in pygame.event.get():
13 if event.type == pygame.QUIT:
14 running = False
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)