fix text removing
This commit is contained in:
parent
ed9dc82541
commit
ba315ef495
18
main.py
18
main.py
@ -35,8 +35,6 @@ liste_des_sprites.add(avion)
|
|||||||
liste_d_ananas = []
|
liste_d_ananas = []
|
||||||
|
|
||||||
if running == True:
|
if running == True:
|
||||||
keys = pygame.key.get_pressed()
|
|
||||||
|
|
||||||
police = pygame.font.Font(None, 25)
|
police = pygame.font.Font(None, 25)
|
||||||
texte = pygame.sprite.Sprite()
|
texte = pygame.sprite.Sprite()
|
||||||
pygame.sprite.Sprite.__init__(texte)
|
pygame.sprite.Sprite.__init__(texte)
|
||||||
@ -45,8 +43,6 @@ if running == True:
|
|||||||
texte.rect.centerx = 360
|
texte.rect.centerx = 360
|
||||||
texte.rect.centery = 30
|
texte.rect.centery = 30
|
||||||
liste_des_sprites.add(texte)
|
liste_des_sprites.add(texte)
|
||||||
if keys[pygame.K_SPACE]:
|
|
||||||
liste_des_sprites.remove(texte)
|
|
||||||
|
|
||||||
police = pygame.font.Font(None, 20)
|
police = pygame.font.Font(None, 20)
|
||||||
texte2 = pygame.sprite.Sprite()
|
texte2 = pygame.sprite.Sprite()
|
||||||
@ -55,8 +51,6 @@ if running == True:
|
|||||||
texte2.rect.centerx = 360
|
texte2.rect.centerx = 360
|
||||||
texte2.rect.centery = 60
|
texte2.rect.centery = 60
|
||||||
liste_des_sprites.add(texte2)
|
liste_des_sprites.add(texte2)
|
||||||
if keys[pygame.K_SPACE]:
|
|
||||||
liste_des_sprites.remove(texte2)
|
|
||||||
|
|
||||||
police = pygame.font.Font(None, 20)
|
police = pygame.font.Font(None, 20)
|
||||||
texte3 = pygame.sprite.Sprite()
|
texte3 = pygame.sprite.Sprite()
|
||||||
@ -65,8 +59,6 @@ if running == True:
|
|||||||
texte3.rect.centerx = 360
|
texte3.rect.centerx = 360
|
||||||
texte3.rect.centery = 80
|
texte3.rect.centery = 80
|
||||||
liste_des_sprites.add(texte3)
|
liste_des_sprites.add(texte3)
|
||||||
if keys[pygame.K_SPACE]:
|
|
||||||
liste_des_sprites.remove(texte3)
|
|
||||||
|
|
||||||
police = pygame.font.Font(None, 20)
|
police = pygame.font.Font(None, 20)
|
||||||
texte4 = pygame.sprite.Sprite()
|
texte4 = pygame.sprite.Sprite()
|
||||||
@ -75,8 +67,6 @@ if running == True:
|
|||||||
texte4.rect.centerx = 360
|
texte4.rect.centerx = 360
|
||||||
texte4.rect.centery = 100
|
texte4.rect.centery = 100
|
||||||
liste_des_sprites.add(texte4)
|
liste_des_sprites.add(texte4)
|
||||||
if keys[pygame.K_SPACE]:
|
|
||||||
liste_des_sprites.remove(texte4)
|
|
||||||
|
|
||||||
police = pygame.font.Font(None, 20)
|
police = pygame.font.Font(None, 20)
|
||||||
texte5 = pygame.sprite.Sprite()
|
texte5 = pygame.sprite.Sprite()
|
||||||
@ -85,10 +75,6 @@ if running == True:
|
|||||||
texte5.rect.centerx = 360
|
texte5.rect.centerx = 360
|
||||||
texte5.rect.centery = 1500
|
texte5.rect.centery = 1500
|
||||||
liste_des_sprites.add(texte5)
|
liste_des_sprites.add(texte5)
|
||||||
if keys[pygame.K_SPACE]:
|
|
||||||
liste_des_sprites.remove(texte5)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gameover = False
|
gameover = False
|
||||||
score = 0
|
score = 0
|
||||||
@ -107,6 +93,10 @@ while running:
|
|||||||
keys = pygame.key.get_pressed()
|
keys = pygame.key.get_pressed()
|
||||||
if keys[pygame.K_SPACE]:
|
if keys[pygame.K_SPACE]:
|
||||||
liste_des_sprites.remove(texte)
|
liste_des_sprites.remove(texte)
|
||||||
|
liste_des_sprites.remove(texte2)
|
||||||
|
liste_des_sprites.remove(texte3)
|
||||||
|
liste_des_sprites.remove(texte4)
|
||||||
|
liste_des_sprites.remove(texte5)
|
||||||
if gameover == False:
|
if gameover == False:
|
||||||
nombre_aleatoire = randint(0, 100)
|
nombre_aleatoire = randint(0, 100)
|
||||||
if nombre_aleatoire == 100:
|
if nombre_aleatoire == 100:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user