main: bullet sound
This commit is contained in:
parent
85ad7d08ef
commit
b6f1a9c050
BIN
laser-shot-ingame-230500.mp3
Normal file
BIN
laser-shot-ingame-230500.mp3
Normal file
Binary file not shown.
2
main.py
2
main.py
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user