Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def sound_effect(sound_file):
- pygame.mixer.init()
- pygame.mixer.Sound(sound_file)
- pygame.mixer.Sound(sound_file).play().set_volume(0.2)
- def fire_bullet(si_settings, screen, ship, bullets):
- """Fire a bullet, if limit not reached yet."""
- if len(bullets) < si_settings.bullets_allowed:
- new_bullet = Bullet(si_settings, screen, ship)
- bullets.add(new_bullet)
- sound_effect('sounds/shoot.wav')`
Add Comment
Please, Sign In to add comment