Compare commits
2 Commits
24c1a35c7d
...
85db1d9f6c
Author | SHA1 | Date | |
---|---|---|---|
85db1d9f6c | |||
8888dab3f2 |
67
main.py
67
main.py
@ -114,7 +114,6 @@ while running:
|
||||
avion.rect.x = event.pos[0]
|
||||
if event.type == MOUSEBUTTONDOWN:
|
||||
print("Vous avez tué l'ennemi! Continuez!")
|
||||
liste_d_ananas.remove(ananas)
|
||||
nouveau_missile = tirer_missiles(avion.rect.centerx, HAUTEUR/2)
|
||||
liste_de_missiles.append(nouveau_missile) == [nouveau_missile]
|
||||
liste_sprites_missiles.add(nouveau_missile) == pygame.sprite.Group(nouveau_missile)
|
||||
@ -131,46 +130,42 @@ while running:
|
||||
if ananas.rect.colliderect(avion):
|
||||
print("COLLISION, L'OBJET A ÉTÉ ÉLIMINÉ, MALHEUREUSEMENT, VOUS AUSSI")
|
||||
liste_d_ananas.remove(ananas)
|
||||
ananas.kill()
|
||||
gameover = True
|
||||
ananas.kill()
|
||||
if ananas.rect.y > HAUTEUR:
|
||||
gameover = True
|
||||
|
||||
police = pygame.font.Font(None, 36)
|
||||
texte1 = pygame.sprite.Sprite()
|
||||
pygame.sprite.Sprite.__init__(texte1)
|
||||
texte1.image = police.render("Gameover.", 1, (10,10,10),(255, 90, 20))
|
||||
texte1.rect = texte1.image.get_rect()
|
||||
texte1.rect.centerx = 360
|
||||
texte1.rect.centery = 450
|
||||
liste_des_sprites.add(texte1)
|
||||
|
||||
police = pygame.font.Font(None, 36)
|
||||
texte22 = pygame.sprite.Sprite()
|
||||
pygame.sprite.Sprite.__init__(texte22)
|
||||
texte22.image = police.render("L'ennemi est entré dans notre atmosphère!", 1, (10,10,10),(255, 90, 20))
|
||||
texte22.rect = texte22.image.get_rect()
|
||||
texte22.rect.centerx = 360
|
||||
texte22.rect.centery = 500
|
||||
liste_des_sprites.add(texte22)
|
||||
|
||||
police = pygame.font.Font(None, 36)
|
||||
texte33 = pygame.sprite.Sprite()
|
||||
pygame.sprite.Sprite.__init__(texte33)
|
||||
texte33.image = police.render("Réessaye de tuer tout les ennemis!", 1, (10,10,10),(255, 90, 20))
|
||||
texte33.rect = texte33.image.get_rect()
|
||||
texte33.rect.centerx = 360
|
||||
texte33.rect.centery = 450
|
||||
liste_des_sprites.add(texte33)
|
||||
|
||||
for missiles in liste_de_missiles:
|
||||
ananas.rect.y -= 1
|
||||
if missiles.rect.colliderect(ananas):
|
||||
print("COLLISION, L'OBJET A ÉTÉ ÉLIMINÉ")
|
||||
missiles.rect.y -= 1
|
||||
if missiles.rect.y <= 0:
|
||||
liste_de_missiles.remove(missiles)
|
||||
ananas.kill()
|
||||
if ananas.rect.y <= 0:
|
||||
gameover = True
|
||||
|
||||
police = pygame.font.Font(None, 36)
|
||||
texte1 = pygame.sprite.Sprite()
|
||||
pygame.sprite.Sprite.__init__(texte1)
|
||||
texte1.image = police.render("Gameover.", 1, (10,10,10),(255, 90, 20))
|
||||
texte1.rect = texte1.image.get_rect()
|
||||
texte1.rect.centerx = 360
|
||||
texte1.rect.centery = 450
|
||||
liste_des_sprites.add(texte1)
|
||||
|
||||
police = pygame.font.Font(None, 36)
|
||||
texte22 = pygame.sprite.Sprite()
|
||||
pygame.sprite.Sprite.__init__(texte22)
|
||||
texte22.image = police.render("L'ennemi est entré dans notre atmosphère!", 1, (10,10,10),(255, 90, 20))
|
||||
texte22.rect = texte22.image.get_rect()
|
||||
texte22.rect.centerx = 360
|
||||
texte22.rect.centery = 500
|
||||
liste_des_sprites.add(texte22)
|
||||
|
||||
police = pygame.font.Font(None, 36)
|
||||
texte33 = pygame.sprite.Sprite()
|
||||
pygame.sprite.Sprite.__init__(texte33)
|
||||
texte33.image = police.render("Réessaye de tuer tout les ennemis!", 1, (10,10,10),(255, 90, 20))
|
||||
texte33.rect = texte33.image.get_rect()
|
||||
texte33.rect.centerx = 360
|
||||
texte33.rect.centery = 450
|
||||
liste_des_sprites.add(texte33)
|
||||
missiles.kill()
|
||||
|
||||
pygame.display.flip()
|
||||
fenetre.fill((0,0,0))
|
||||
|
Loading…
x
Reference in New Issue
Block a user