main: bullet sound

This commit is contained in:
Stefan Liebl 2024-12-28 21:09:02 +01:00
parent 85ad7d08ef
commit b6f1a9c050
2 changed files with 2 additions and 0 deletions

Binary file not shown.

View File

@ -33,6 +33,7 @@ def creer_ananas(pos_x, pos_y):
ananas.rect.y = pos_y
return ananas
pygame.init()
bullet_sound = pygame.mixer.Sound('laser-shot-ingame-230500.mp3')
clock = pygame.time.Clock()
running = True
avion = pygame.sprite.Sprite()
@ -103,6 +104,7 @@ while running:
nouvel_bullet = creer_bullet(avion.rect.centerx, avion.rect.y)
liste_d_bullets.append(nouvel_bullet)
liste_sprites_bullets.add(nouvel_bullet)
pygame.mixer.Sound.play(bullet_sound)
keys = pygame.key.get_pressed()
if keys[pygame.K_SPACE]:
liste_des_sprites.remove(texte)