Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- import logging
- root = Tk()
- root.title('CLICKER')
- root.geometry('350x200')
- score = int(0)
- s = 0
- x = 1
- buy = 1
- aga = Label (root, bg='white', fg='black', text='Твой счет:', width=50)
- scoreboard = Label (root, bg='white', fg='black', text=score)
- text = Label (root, bg='white', fg='black', width=50, text='НАЖМИ НА КНОПКУ')
- button1 = Button(root, bg='red', fg='white', text='CLICK', width=50)
- button2 = Button(root, bg='red', fg='white', text='CLOSE', width=50)
- buy_slot = Button(root, bg='white', fg='black', text='Купить улучшение\nза 10 очков', width=50)
- def strToSortlist(event):
- global x
- if x == 1:
- text.config(text='+1 очко')
- global s
- s += 1
- scoreboard.config(text=s)
- elif x == 2:
- text.config(text='+2 очка')
- s += 2
- scoreboard.config(text=score)
- def strDestroy(event):
- root.destroy()
- def strBuy(event):
- global x
- global score
- if x == 1:
- if int(score) > 10:
- buy_slot.config(text='Купить улучшение за 100')
- score -= 10
- x += 1
- text.config(text='Покупка удачная!')
- elif score < 10:
- text.config(text='Недостаточно очков!')
- button1.bind('<Button-1>', strToSortlist)
- button2.bind('<Button-1>', strDestroy)
- buy_slot.bind('<Button-1>', strBuy)
- aga.pack()
- scoreboard.pack()
- text.pack()
- button1.pack()
- buy_slot.pack()
- button2.pack()
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement