mirror of
https://github.com/Fare-spec/cours.git
synced 2025-12-09 11:30:38 +00:00
formatte file
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import sys, pygame
|
||||
import sys, pygame
|
||||
import balle
|
||||
import raquette
|
||||
from constantes import *
|
||||
@@ -6,10 +6,10 @@ from constantes import *
|
||||
pygame.init()
|
||||
|
||||
# Creation de la fenetre
|
||||
ecran = pygame.display.set_mode((LARGEUR_ECRAN,HAUTEUR_ECRAN))
|
||||
ecran = pygame.display.set_mode((LARGEUR_ECRAN, HAUTEUR_ECRAN))
|
||||
|
||||
# Titre de la fenetre
|
||||
pygame.display.set_caption('Casse_Brique')
|
||||
pygame.display.set_caption("Casse_Brique")
|
||||
|
||||
clock = pygame.time.Clock()
|
||||
|
||||
@@ -19,25 +19,23 @@ bouge = False
|
||||
bouge_gauche_raquette = False
|
||||
bouge_droite_raquette = False
|
||||
|
||||
while True :
|
||||
for event in pygame.event.get() :
|
||||
if event.type == pygame.QUIT :
|
||||
while True:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
sys.exit()
|
||||
elif event.type == pygame.KEYDOWN and event.key == pygame.K_SPACE :
|
||||
elif event.type == pygame.KEYDOWN and event.key == pygame.K_SPACE:
|
||||
bouge = not bouge
|
||||
|
||||
|
||||
if pygame.key.get_pressed()[pygame.K_q]:
|
||||
r1.deplaceGauche()
|
||||
if pygame.key.get_pressed()[pygame.K_d]:
|
||||
r1.deplaceDroite()
|
||||
|
||||
ecran.fill(BLANC)
|
||||
|
||||
if bouge :
|
||||
|
||||
if bouge:
|
||||
b1.deplace(r1)
|
||||
|
||||
|
||||
|
||||
|
||||
b1.deplace(r1)
|
||||
b1.affiche(ecran)
|
||||
r1.affiche(ecran)
|
||||
|
||||
Reference in New Issue
Block a user