Add score

This commit is contained in:
2019-03-17 22:03:25 +01:00
parent e5adda3e93
commit a88729ee0e

11
main.py
View File

@@ -19,9 +19,10 @@ image_center = ImageTk.PhotoImage(Image.open('res/logo/main.png'))
time = None
delta = None
iter = 0
score = tk.IntVar(win, 0)
def loop(deltaTime):
global time, delta, iter
global time, delta, iter, score
# Start
delta = dt.datetime.now()
@@ -33,8 +34,9 @@ def loop(deltaTime):
osu.loop(deltatime)
pong.loop(deltatime)
space.loop(deltatime)
else:
iter += 1
score.set(int(iter / 5))
iter += 1
# End
time = delta
@@ -57,6 +59,9 @@ def main():
win.iconbitmap('res/logo/main.ico')
tk.Label(win, image = image_center, bg = color.LEVEL_1).place(x = 401 - 32, y = 301 - 32)
# Score
tk.Label(win, textvariable = score, bg = color.LEVEL_1, fg = color.BROWN, font = (None, 12)).place(x = 2, y = 2)
# Ini
fall.main(canvas_fall)
osu.main(canvas_osu)