added sound effects
This commit is contained in:
parent
f2fa64318a
commit
575a2e3d8d
6 changed files with 13 additions and 8 deletions
10
ben10.py
10
ben10.py
|
@ -3,6 +3,9 @@ from aliens import alien_table
|
||||||
from functions import *
|
from functions import *
|
||||||
from PIL import ImageTk, Image
|
from PIL import ImageTk, Image
|
||||||
|
|
||||||
|
start()
|
||||||
|
# start up sound effect
|
||||||
|
|
||||||
root = Tk()
|
root = Tk()
|
||||||
root.title("Omnitrix")
|
root.title("Omnitrix")
|
||||||
# root.attributes('-fullscreen', True)
|
# root.attributes('-fullscreen', True)
|
||||||
|
@ -10,7 +13,6 @@ root.geometry("640x480")
|
||||||
root.configure(bg="#70b607")
|
root.configure(bg="#70b607")
|
||||||
root.columnconfigure(1, weight=1)
|
root.columnconfigure(1, weight=1)
|
||||||
root.rowconfigure(1, weight=1)
|
root.rowconfigure(1, weight=1)
|
||||||
|
|
||||||
# root window parameters
|
# 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)
|
quit_button.grid(column=1, row=3, columnspan=2)
|
||||||
# kills program
|
# 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()
|
root.mainloop()
|
||||||
|
|
11
functions.py
11
functions.py
|
@ -1,10 +1,11 @@
|
||||||
from aliens import *
|
from aliens import *
|
||||||
from PIL import ImageTk, Image
|
from PIL import ImageTk, Image
|
||||||
|
from playsound import playsound as sound
|
||||||
|
|
||||||
counter = 0
|
counter = 0
|
||||||
|
|
||||||
|
|
||||||
def count_up(omnitrix_button):
|
def count_up(omnitrix_button):
|
||||||
|
sound("res/sound_switch.mp3")
|
||||||
global counter
|
global counter
|
||||||
counter += 1
|
counter += 1
|
||||||
print(counter)
|
print(counter)
|
||||||
|
@ -18,6 +19,7 @@ def count_up(omnitrix_button):
|
||||||
|
|
||||||
|
|
||||||
def count_down(omnitrix_button):
|
def count_down(omnitrix_button):
|
||||||
|
sound("res/sound_switch.mp3")
|
||||||
global counter
|
global counter
|
||||||
counter -= 1
|
counter -= 1
|
||||||
print(counter)
|
print(counter)
|
||||||
|
@ -31,6 +33,7 @@ def count_down(omnitrix_button):
|
||||||
|
|
||||||
|
|
||||||
def button_press():
|
def button_press():
|
||||||
|
sound("res/sound_transformation.mp3")
|
||||||
if counter < 0:
|
if counter < 0:
|
||||||
print(alien_table(counter * -1))
|
print(alien_table(counter * -1))
|
||||||
elif counter == 0:
|
elif counter == 0:
|
||||||
|
@ -41,6 +44,7 @@ def button_press():
|
||||||
|
|
||||||
|
|
||||||
def skip_up(omnitrix_button):
|
def skip_up(omnitrix_button):
|
||||||
|
sound("res/sound_switch.mp3")
|
||||||
global counter
|
global counter
|
||||||
counter += 5
|
counter += 5
|
||||||
print(counter)
|
print(counter)
|
||||||
|
@ -54,6 +58,7 @@ def skip_up(omnitrix_button):
|
||||||
|
|
||||||
|
|
||||||
def skip_down(omnitrix_button):
|
def skip_down(omnitrix_button):
|
||||||
|
sound("res/sound_switch.mp3")
|
||||||
global counter
|
global counter
|
||||||
counter -= 5
|
counter -= 5
|
||||||
print(counter)
|
print(counter)
|
||||||
|
@ -64,3 +69,7 @@ def skip_down(omnitrix_button):
|
||||||
img = ImageTk.PhotoImage(Image.open(path))
|
img = ImageTk.PhotoImage(Image.open(path))
|
||||||
omnitrix_button.configure(image=img)
|
omnitrix_button.configure(image=img)
|
||||||
omnitrix_button.image = img # keep a reference!
|
omnitrix_button.image = img # keep a reference!
|
||||||
|
|
||||||
|
|
||||||
|
def start():
|
||||||
|
sound("res/sound_startup.mp3")
|
BIN
res/sound_shutdown.mp3
Normal file
BIN
res/sound_shutdown.mp3
Normal file
Binary file not shown.
BIN
res/sound_startup.mp3
Normal file
BIN
res/sound_startup.mp3
Normal file
Binary file not shown.
BIN
res/sound_switch.mp3
Normal file
BIN
res/sound_switch.mp3
Normal file
Binary file not shown.
BIN
res/sound_transformation.mp3
Normal file
BIN
res/sound_transformation.mp3
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue