added sound effects

This commit is contained in:
superdimensional 2021-05-01 23:58:10 -04:00
parent f2fa64318a
commit 575a2e3d8d
6 changed files with 13 additions and 8 deletions

View file

@ -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()

View file

@ -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")

BIN
res/sound_shutdown.mp3 Normal file

Binary file not shown.

BIN
res/sound_startup.mp3 Normal file

Binary file not shown.

BIN
res/sound_switch.mp3 Normal file

Binary file not shown.

Binary file not shown.