SHOW:
|
|
- or go back to the newest paste.
1 | import pygame # importing the module | |
2 | WIDTH = 800 | |
3 | HEIGHT = 600 | |
4 | pygame.init() # initializing the module | |
5 | window = pygame.display.set_mode((WIDTH, HEIGHT)) # making the window of size WIDTH and HEIGHT | |
6 | ||
7 | run = True # Game status -> game is running | |
8 | # clock = pygame.time.Clock() # initialize clock | |
9 | ||
10 | while run: #-> while the game is running | |
11 | # clock.tick(60) # 60 frames per second | |
12 | window.fill((0, 0, 0)) | |
13 | for event in pygame.event.get(): # for each event occuring in the window | |
14 | if event.type == pygame.QUIT: # checking if the close button was pressed | |
15 | run = False # update game status to stop (not running) | |
16 | ||
17 | pygame.display.flip() # update our window with all the changes that we have done | |
18 | pygame.quit() # close the window |