Commit a58bb1a8 authored by santiago duque's avatar santiago duque

added second button and logic to stop events as a test

parent 95542bc4
...@@ -34,7 +34,6 @@ def setup_sounds(): ...@@ -34,7 +34,6 @@ def setup_sounds():
global contentlist global contentlist
global sound_dir global sound_dir
print("inside setup")
print(contentlist) print(contentlist)
for content in contentlist: for content in contentlist:
...@@ -45,14 +44,10 @@ def setup_sounds(): ...@@ -45,14 +44,10 @@ def setup_sounds():
): ):
sound = pygame.mixer.Sound(join(sound_dir, content)) sound = pygame.mixer.Sound(join(sound_dir, content))
sound_array.append(sound) sound_array.append(sound)
print(content)
print("sound array")
print(sound_array) print(sound_array)
sound_playing = False sound_playing = False
def play_sound(index): def play_sound(index):
global sound_playing global sound_playing
global cut_current_sound global cut_current_sound
...@@ -69,7 +64,7 @@ def play_sound(index): ...@@ -69,7 +64,7 @@ def play_sound(index):
channel = sound_array[current_sound_index].play() channel = sound_array[current_sound_index].play()
while channel.get_busy(): while channel.get_busy():
pygame.time.wait(100) # ms #pygame.time.wait(100) # ms
print("Playing...") print("Playing...")
print(btn_array[current_sound_index].is_held) print(btn_array[current_sound_index].is_held)
print(btn_array[current_sound_index].is_pressed) print(btn_array[current_sound_index].is_pressed)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment