1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| import pygame, sys
from pygame.locals import *
pygame.init()
# Init de clock
clock = pygame.time.Clock()
CIEL = 0, 200, 255
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
def main():
fenetre = pygame.display.set_mode((640, 480))
loop = True
background = pygame.Surface(fenetre.get_size())
while loop:
for event in pygame.event.get():
if event.type == pygame.QUIT:
loop = False
background.fill(CIEL)
fenetre.blit(background, (0, 0))
pygame.display.flip()
clock.tick(10)
def quit():
pygame.quit()
sys.exit()
if __name__ == '__main__':
main()
quit() |
Partager