-
Notifications
You must be signed in to change notification settings - Fork 0
/
Q-clicker.py
122 lines (77 loc) · 2.51 KB
/
Q-clicker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
from tkinter import *
#setting up window
win = Tk()
win.title("Q-clicker")
win.geometry("240x350")
win.configure(bg = 'blue')
#setting background
img004 = PhotoImage(file="BackGround.png")
label004 = Label(win, image = img004)
label004.place(x=0, y=0)
#displaying balance
label2 = Label(text = "Balance :", bg = 'blue', fg = 'white')
label2.pack()
UC = 0
label1 = Label(text = UC, bg = 'blue', fg = 'white')
label1.pack()
#setting button clicker
addedC = 1
def clicked():
global addedC
global UC
UC += addedC
label1.config(text = UC)
photclickB = PhotoImage(file = "Buttonclicker.png")
button1 = Button(win, text = "Click", command = clicked, image = photclickB, bg = 'blue', fg = 'white')
button1.pack()
label02 = Label(win, text = "your click add count is : ", bg = 'blue', fg = 'white')
label3 = Label(win, text = addedC, bg = 'blue', fg = 'white')
label02.pack()
label3.pack()
#set and display add count
addcost = 10
addvalue = 1
def updateclickC():
global addedC
global UC
global addcost
global addvalue
if UC > addcost - 1:
addedC = addedC + addvalue
UC -= addcost
label1.config(text = UC)
label3.config(text = addedC)
label001.config(text = addcost)
addcost += 10
addvalue = addvalue + 1
photclick3B = PhotoImage(file = "addtoclick.png")
button2 = Button(win, text = "increase click count", command = updateclickC, image = photclick3B, bg = 'blue', fg = 'white')
label00 = Label(win, text = "cost is : ", bg = 'blue', fg = 'white')
label001 = Label(win, text = addcost, bg = 'blue', fg = 'white')
button2.pack()
label00.pack()
label001.pack()
#setting multiplayng adding count button and displaying it
multiplycost = 10000
multiplyedvalue = 10
def multiplycount():
global UC
global addedC
global multiplycost
global multiplyedvalue
if UC > multiplycost - 1:
UC -= multiplycost
addedC = addedC * multiplyedvalue
label1.config(text = UC)
label3.config(text = addedC)
label03.config(text = multiplycost)
multiplycost = multiplycost * 5
multiplyedvalue += 1
photclick2B = PhotoImage(file = "multiplytoclick.png")
button3 = Button(win, text = "multiply click count x10", command = multiplycount, image = photclick2B, bg = 'blue', fg = 'white')
label12 = Label(win, text = "cost is : ", bg = 'blue', fg = 'white')
label03 = Label(win, text = multiplycost, bg = 'blue', fg = 'white')
button3.pack()
label12.pack()
label03.pack()
win.mainloop()