2017-11-08 13:26:53 +00:00
|
|
|
# Importation de pygame
|
2017-10-29 07:33:01 +00:00
|
|
|
import pygame
|
|
|
|
|
|
|
|
pygame.init()
|
|
|
|
|
2017-11-08 13:26:53 +00:00
|
|
|
# Initialisation de la fenetre
|
2017-10-29 07:33:01 +00:00
|
|
|
largeur = 600
|
|
|
|
hauteur = 400
|
|
|
|
windowSurface = pygame.display.set_mode((largeur, hauteur), 0,32)
|
|
|
|
|
2017-11-08 13:26:53 +00:00
|
|
|
# Initialisation des parametres
|
|
|
|
|
|
|
|
|
|
|
|
# Boucle de jeu
|
|
|
|
clock = pygame.time.Clock()
|
2017-10-29 07:33:01 +00:00
|
|
|
running = True
|
|
|
|
while running:
|
2017-11-08 13:26:53 +00:00
|
|
|
# Limitation du nombre de tours de boucle par seconde.
|
|
|
|
clock.tick(10)
|
|
|
|
# Boucle des evenements
|
2017-10-29 07:33:01 +00:00
|
|
|
for event in pygame.event.get():
|
|
|
|
if event.type == pygame.QUIT:
|
|
|
|
running = False
|
|
|
|
|
2017-11-08 13:26:53 +00:00
|
|
|
# Elements a tracer
|
|
|
|
|
|
|
|
pygame.display.update()
|
|
|
|
|
|
|
|
|
2017-10-29 07:33:01 +00:00
|
|
|
pygame.quit()
|