diff --git a/ben10.py b/ben10.py index 021209a..e39ee01 100644 --- a/ben10.py +++ b/ben10.py @@ -3,6 +3,9 @@ from aliens import alien_table from functions import * from PIL import ImageTk, Image +start() +# start up sound effect + root = Tk() root.title("Omnitrix") # root.attributes('-fullscreen', True) @@ -10,7 +13,6 @@ root.geometry("640x480") root.configure(bg="#70b607") root.columnconfigure(1, weight=1) root.rowconfigure(1, weight=1) - # root window parameters @@ -51,10 +53,4 @@ quit_button = Button(root, text="X", fg="white", bg="black", quit_button.grid(column=1, row=3, columnspan=2) # kills program -# change_entry = Entry(root, fg="black", bg="white", -# highlightthickness=0, bd=0, width=5) -# change_entry.grid(column=1, row=0, columnspan=2) -# change to specific entry - - root.mainloop() diff --git a/functions.py b/functions.py index 4e57203..5966ba3 100644 --- a/functions.py +++ b/functions.py @@ -1,10 +1,11 @@ from aliens import * from PIL import ImageTk, Image +from playsound import playsound as sound counter = 0 - def count_up(omnitrix_button): + sound("res/sound_switch.mp3") global counter counter += 1 print(counter) @@ -18,6 +19,7 @@ def count_up(omnitrix_button): def count_down(omnitrix_button): + sound("res/sound_switch.mp3") global counter counter -= 1 print(counter) @@ -31,6 +33,7 @@ def count_down(omnitrix_button): def button_press(): + sound("res/sound_transformation.mp3") if counter < 0: print(alien_table(counter * -1)) elif counter == 0: @@ -41,6 +44,7 @@ def button_press(): def skip_up(omnitrix_button): + sound("res/sound_switch.mp3") global counter counter += 5 print(counter) @@ -54,6 +58,7 @@ def skip_up(omnitrix_button): def skip_down(omnitrix_button): + sound("res/sound_switch.mp3") global counter counter -= 5 print(counter) @@ -64,3 +69,7 @@ def skip_down(omnitrix_button): img = ImageTk.PhotoImage(Image.open(path)) omnitrix_button.configure(image=img) omnitrix_button.image = img # keep a reference! + + +def start(): + sound("res/sound_startup.mp3") \ No newline at end of file diff --git a/res/sound_shutdown.mp3 b/res/sound_shutdown.mp3 new file mode 100644 index 0000000..a1dc9d1 Binary files /dev/null and b/res/sound_shutdown.mp3 differ diff --git a/res/sound_startup.mp3 b/res/sound_startup.mp3 new file mode 100644 index 0000000..52fb283 Binary files /dev/null and b/res/sound_startup.mp3 differ diff --git a/res/sound_switch.mp3 b/res/sound_switch.mp3 new file mode 100644 index 0000000..58ea136 Binary files /dev/null and b/res/sound_switch.mp3 differ diff --git a/res/sound_transformation.mp3 b/res/sound_transformation.mp3 new file mode 100644 index 0000000..54f9676 Binary files /dev/null and b/res/sound_transformation.mp3 differ