From a26a601bf88655b1e33f9a3573feaecafab961bf Mon Sep 17 00:00:00 2001 From: superdimensional Date: Tue, 27 Apr 2021 22:27:25 -0400 Subject: [PATCH] added aliens to a list --- aliens.py | 18 ++++++++++++++++++ ben10.py | 28 ++++++++++++++-------------- 2 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 aliens.py diff --git a/aliens.py b/aliens.py new file mode 100644 index 0000000..127e754 --- /dev/null +++ b/aliens.py @@ -0,0 +1,18 @@ + +def alien_table(index): + return { + + 0: "Heatblast", + 1: "Cannonbolt", + 2: "Ripjaws", + 3: "Diamondhead", + 4: "Stinkfly", + 5: "Fourarms", + 6: "Upgrade", + 7: "XLR8", + 8: "Grey Matter", + 9: "Wildmutt", + 10: "Ghostfreak", + 11: "Wildvine", + + }.get(index, "error") \ No newline at end of file diff --git a/ben10.py b/ben10.py index 1b3235c..ade7e29 100644 --- a/ben10.py +++ b/ben10.py @@ -1,24 +1,24 @@ from tkinter import * +from aliens import alien_table root = Tk() root.title("Omnitrix") # root.attributes('-fullscreen', True) -count = 0 - +counter= 0 def count_up(): - global count - count += 1 - print(count) + global counter + counter+= 1 + # print(counter) def count_down(): - global count - count -= 1 - print(count) + global counter + counter-= 1 + # print(counter) -def start(): - print("start") +def transform(): + print(alien_table(counter)) root.geometry("640x480") root.configure(bg="#70b607") @@ -26,15 +26,15 @@ root.configure(bg="#70b607") omnitrix_screen = PhotoImage(file="omnitrix.png") omnitrix_button = Button(root, image=omnitrix_screen, bg="#70b607", - activebackground='#70b607', highlightthickness=0, bd=0, command=start) + activebackground='#70b607', highlightthickness=0, bd=0, command=transform) omnitrix_button.place(relx=0.5, rely=0.5, anchor=CENTER) -quit_button = Button(root, text="X", fg="white",command=root.destroy) +quit_button = Button(root, text="X", fg="white",command=root.destroy, highlightthickness=0, bd=0) quit_button.place(rely=1.0, relx=1.0, x=0, y=0, anchor=SE) -omnitrix_left = Button(root, text="<", fg="white", bg="black" ,command=count_down, highlightthickness=0, bd=0, height = 25) -omnitrix_right = Button(root, text=">", fg="white", bg="black" ,command=count_up, highlightthickness=0, bd=0, height = 25) +omnitrix_left = Button(root, text="<", fg="white", bg="black" ,command=count_down, highlightthickness=0, bd=0, height = 20) +omnitrix_right = Button(root, text=">", fg="white", bg="black" ,command=count_up, highlightthickness=0, bd=0, height = 20) omnitrix_left.pack(side="left") omnitrix_right.pack(side="right")