diff --git a/ben10.py b/ben10.py index ade7e29..56989bf 100644 --- a/ben10.py +++ b/ben10.py @@ -1,24 +1,10 @@ from tkinter import * from aliens import alien_table - +from functions import * root = Tk() root.title("Omnitrix") # root.attributes('-fullscreen', True) -counter= 0 - -def count_up(): - global counter - counter+= 1 - # print(counter) - -def count_down(): - global counter - counter-= 1 - # print(counter) - -def transform(): - print(alien_table(counter)) root.geometry("640x480") root.configure(bg="#70b607") diff --git a/functions.py b/functions.py new file mode 100644 index 0000000..5b5277a --- /dev/null +++ b/functions.py @@ -0,0 +1,21 @@ +from aliens import alien_table + +counter= 0 + +def count_up(): + global counter + counter+= 1 + # print(counter) + +def count_down(): + global counter + counter-= 1 + # print(counter) + +def transform(): + if counter < 0: + print(alien_table(counter * -1)) + elif counter == 0: + print(alien_table(counter)) + elif counter > 0: + print(alien_table(counter))