Add music in breaks #30

Merged
Shikiryu merged 1 commits from enhance/break_music into main 2023-06-15 11:34:34 +02:00
3 changed files with 6 additions and 0 deletions
Showing only changes of commit e27769c8f3 - Show all commits

BIN
assets/sounds/elevator.mp3 Normal file

Binary file not shown.

View File

@ -20,8 +20,10 @@ class ImagePlaceholder:
if image_path == "break": if image_path == "break":
self.is_break = True self.is_break = True
image_path = 'assets/images/break.jpg' image_path = 'assets/images/break.jpg'
self.image_window.play_elevator()
else: else:
self.is_break = False self.is_break = False
self.image_window.elevator_sound.stop()
self.current_original_image = Image.open(image_path) self.current_original_image = Image.open(image_path)
self.current_image = copy.deepcopy(self.current_original_image) self.current_image = copy.deepcopy(self.current_original_image)
self.apply_options() self.apply_options()

View File

@ -26,6 +26,7 @@ class ImageWindow:
mixer.init() mixer.init()
self.countdown_sound = mixer.Sound('assets/sounds/countdown.mp3') self.countdown_sound = mixer.Sound('assets/sounds/countdown.mp3')
self.elevator_sound = mixer.Sound('assets/sounds/elevator.mp3')
self.images = [] self.images = []
self.current_image = None self.current_image = None
@ -71,3 +72,6 @@ class ImageWindow:
def play_countdown(self): def play_countdown(self):
self.countdown_sound.play() self.countdown_sound.play()
def play_elevator(self):
self.elevator_sound.play()