added comments

This commit is contained in:
superdimensional 2021-05-02 00:23:48 -04:00
parent df5f5d4263
commit 886366dc0a
2 changed files with 10 additions and 4 deletions

View file

@ -23,4 +23,5 @@ def alien_table(index):
18: "Frankenstrike",
19: "Blitzwolfer",
# TODO: Add more aliens
}.get(index, 0)
}.get(index, 0)
# list of aliens program can displays

View file

@ -3,6 +3,7 @@ from PIL import ImageTk, Image
from playsound import playsound as sound
counter = 0
# determans which image is shown
def count_up(omnitrix_button):
sound("res/sound_switch.mp3")
@ -16,7 +17,7 @@ def count_up(omnitrix_button):
img = ImageTk.PhotoImage(Image.open(path))
omnitrix_button.configure(image=img)
omnitrix_button.image = img # keep a reference!
# whenever "omnitrix_left" button is pressed, plays sound effect, adds 1 to the counter and change the image
def count_down(omnitrix_button):
sound("res/sound_switch.mp3")
@ -30,11 +31,12 @@ def count_down(omnitrix_button):
img = ImageTk.PhotoImage(Image.open(path))
omnitrix_button.configure(image=img)
omnitrix_button.image = img # keep a reference!
# whenever "omnitrix_left" button is pressed, plays sound effect, subtracts 1 to the counter and change the image
def button_press():
sound("res/sound_transformation.mp3")
# whenever the "middle_button" button is pressed play sound effect
def skip_up(omnitrix_button):
@ -49,6 +51,7 @@ def skip_up(omnitrix_button):
img = ImageTk.PhotoImage(Image.open(path))
omnitrix_button.configure(image=img)
omnitrix_button.image = img # keep a reference!
# whenever "omnitrix_left_skip" button is pressed, plays sound effect, adds 5 to the counter and change the image
def skip_down(omnitrix_button):
@ -63,11 +66,12 @@ def skip_down(omnitrix_button):
img = ImageTk.PhotoImage(Image.open(path))
omnitrix_button.configure(image=img)
omnitrix_button.image = img # keep a reference!
# whenever "omnitrix_right_skip" button is pressed, plays sound effect, subtracts 5 to the counter and change the image
def start():
sound("res/sound_startup.mp3")
# when program first starts up, plays sound effect
def image_display(index):
alien = alien_table(index)
@ -78,3 +82,4 @@ def image_display(index):
else:
image_location = "res/" + alien + ".png"
return image_location
# if the next alien does not exists, resets counter, else returns image location