Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- import sys
- from PIL import ImageTk, Image
- import json
- import winsound
- import random as rd
- winsound.PlaySound("Gabe the dog - End Game.wav", winsound.SND_LOOP+winsound.SND_ASYNC)
- try:
- with open("player_stats.json", "r") as player_stats:
- player_stats = json.load(player_stats)
- except FileNotFoundError:
- player_stats = {"dogecoins": 0, "power": 1}
- screen = Tk()
- screen.title("Clicker")
- screen.iconbitmap("DogDolanOdPajczaka1.ico")
- screen.config(bg="black")
- button_image = ImageTk.PhotoImage(Image.open("DogDolanOdPajczaka1.png").resize((220, 220)))
- wasy_image = ImageTk.PhotoImage(Image.open("wasy.png").resize((100, 100)))
- kapelusz_image = ImageTk.PhotoImage(Image.open("kapelusz.png").resize((100, 100)))
- puszka_image = ImageTk.PhotoImage(Image.open("puszka.jpg").resize((100, 100)))
- przysmak_image = ImageTk.PhotoImage(Image.open("przysmak.png").resize((100, 100)))
- kosc_image = ImageTk.PhotoImage(Image.open("kosc.jpg").resize((100, 100)))
- korona_image = ImageTk.PhotoImage(Image.open("korona.jpg").resize((100, 100)))
- piwo_image = ImageTk.PhotoImage(Image.open("piwo.jpg").resize((100, 100)))
- komputer_image = ImageTk.PhotoImage(Image.open("komputer.jpg").resize((100, 100)))
- rozdzka_image = ImageTk.PhotoImage(Image.open("rozdzka.jpg").resize((100, 100)))
- willa_image = ImageTk.PhotoImage(Image.open("willa.jpg").resize((100, 100)))
- wodka_image = ImageTk.PhotoImage(Image.open("wodka.jpg").resize((100, 100)))
- auto_image = ImageTk.PhotoImage(Image.open("auto.jpg").resize((100, 100)))
- wiedzmin_image = ImageTk.PhotoImage(Image.open("wiedzmin.jpg").resize((100, 100)))
- shiba_image = ImageTk.PhotoImage(Image.open("shiba.jpg").resize((100, 100)))
- marihuana_image = ImageTk.PhotoImage(Image.open("marihuana.jpg").resize((100, 100)))
- brazowa_skrzynia_image = ImageTk.PhotoImage(Image.open("brazowa_skrzynia.jpg").resize((150, 150)))
- zlota_skrzynia_image = ImageTk.PhotoImage(Image.open("zlota_skrzynia.jpg").resize((150, 150)))
- diamentowa_skrzynia_image = ImageTk.PhotoImage(Image.open("diamentowa_skrzynia.jpg").resize((150, 150)))
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',', ' ')} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def on_clicked():
- global label
- global player_stats
- label.destroy()
- player_stats["dogecoins"] += player_stats["power"]
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',', ' ')} DogeCoins",bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- def exit_and_save():
- with open("player_stats.json", "w") as saving_file:
- json.dump(player_stats, saving_file)
- sys.exit()
- def brazowa_skrzynia_command():
- global label
- if player_stats["dogecoins"] < 50000:
- pass
- else:
- player_stats["dogecoins"] -= 50000
- prize = rd.randint(25000, 75000)
- player_stats["dogecoins"] += prize
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- def zlota_skrzynia_command():
- global label
- if player_stats["dogecoins"] < 10000000:
- pass
- else:
- player_stats["dogecoins"] -= 10000000
- prize = rd.randint(2500000, 17500000)
- player_stats["dogecoins"] += prize
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- def diamentowa_skrzynia_command():
- global label
- if player_stats["dogecoins"] < 1000000000:
- pass
- else:
- player_stats["dogecoins"] -= 1000000000
- prize = rd.randint(100000000, 1900000000)
- player_stats["dogecoins"] += prize
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- def wasy_command():
- global label
- global label2
- if player_stats["dogecoins"] < 500:
- pass
- else:
- player_stats["dogecoins"] -= 500
- player_stats["power"] += 1
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def kapelusz_command():
- global label
- global label2
- if player_stats["dogecoins"] < 1400:
- pass
- else:
- player_stats["dogecoins"] -= 1400
- player_stats["power"] += 3
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def puszka_command():
- global label
- global label2
- if player_stats["dogecoins"] < 3000:
- pass
- else:
- player_stats["dogecoins"] -= 3000
- player_stats["power"] += 7
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def przysmak_command():
- global label
- global label2
- if player_stats["dogecoins"] < 10000:
- pass
- else:
- player_stats["dogecoins"] -= 10000
- player_stats["power"] += 23
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def kosc_command():
- global label
- global label2
- if player_stats["dogecoins"] < 30000:
- pass
- else:
- player_stats["dogecoins"] -= 30000
- player_stats["power"] += 71
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def korona_command():
- global label
- global label2
- if player_stats["dogecoins"] < 100000:
- pass
- else:
- player_stats["dogecoins"] -= 100000
- player_stats["power"] += 250
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def piwo_command():
- global label
- global label2
- if player_stats["dogecoins"] < 250000:
- pass
- else:
- player_stats["dogecoins"] -= 250000
- player_stats["power"] += 650
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def komputer_command():
- global label
- global label2
- if player_stats["dogecoins"] < 750000:
- pass
- else:
- player_stats["dogecoins"] -= 750000
- player_stats["power"] += 1960
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def rozdzka_command():
- global label
- global label2
- if player_stats["dogecoins"] < 1500000:
- pass
- else:
- player_stats["dogecoins"] -= 1500000
- player_stats["power"] += 3930
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def wila_comand():
- global label
- global label2
- if player_stats["dogecoins"] < 4500000:
- pass
- else:
- player_stats["dogecoins"] -= 4500000
- player_stats["power"] += 11800
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def wodka_command():
- global label
- global label2
- if player_stats["dogecoins"] < 10000000:
- pass
- else:
- player_stats["dogecoins"] -= 10000000
- player_stats["power"] += 25000
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def auto_command():
- global label
- global label2
- if player_stats["dogecoins"] < 25000000:
- pass
- else:
- player_stats["dogecoins"] -= 25000000
- player_stats["power"] += 62515
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def wiedzmin_command():
- global label
- global label2
- if player_stats["dogecoins"] < 75000000:
- pass
- else:
- player_stats["dogecoins"] -= 75000000
- player_stats["power"] += 187850
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def shiba_command():
- global label
- global label2
- if player_stats["dogecoins"] < 150000000:
- pass
- else:
- player_stats["dogecoins"] -= 150000000
- player_stats["power"] += 375715
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- def marihuana_command():
- global label
- global label2
- if player_stats["dogecoins"] < 500000000:
- pass
- else:
- player_stats["dogecoins"] -= 500000000
- player_stats["power"] += 1500000
- label.destroy()
- label = Label(screen, text=f"You have {str('{:,}'.format(player_stats['dogecoins'])).replace(',',' ' )} DogeCoins", bg="darkblue", font="white", fg="white")
- label.grid(row=0, column=0)
- label2.destroy()
- label2 = Label(screen, text=f"Your click power = {str('{:,}'.format(player_stats['power'])).replace(',', ' ')}", bg="darkblue", font="white", fg="white")
- label2.grid(row=0, column=1)
- button = Button(screen, command=on_clicked, image=button_image)
- exit_button = Button(screen, text="Exit\nand\nsave", command=exit_and_save, bg="darkred", height=5, width=10)
- wasy_button = Button(screen, image=wasy_image, command=wasy_command)
- wasy_cost = Label(screen, text="Cost: -500\nClick power: +1", bg="darkgreen")
- kapelusz_button = Button(screen, image=kapelusz_image, command=kapelusz_command)
- kapelusz_cost = Label(screen, text="Cost: -1400\nClick power: +3", bg="darkgreen")
- puszka_button = Button(screen, image=puszka_image, command=puszka_command)
- puszka_cost = Label(screen, text="Cost: -3000\nClick power: +7", bg="darkgreen")
- przysmak_button = Button(screen, image=przysmak_image, command=przysmak_command)
- przysmak_cost = Label(screen, text="Cost: -10 000\nClick power: +23", bg="darkgreen")
- kosc_button = Button(screen, image=kosc_image, command=kosc_command)
- kosc_cost = Label(screen, text="Cost: -30 000\nClick power: +71", bg="darkgreen")
- korona_button = Button(screen, image=korona_image, command=korona_command)
- korona_cost = Label(screen, text="Cost: -100 000\nClick power: +250", bg="darkgreen")
- piwo_button = Button(screen, image=piwo_image, command=piwo_command)
- piwo_cost = Label(screen, text="Cost: -250 000\nClick power: +650", bg="darkgreen")
- komputer_button = Button(screen, image=komputer_image, command=komputer_command)
- komputer_cost = Label(screen, text="Cost: -750 000\nClick power: +1960", bg="darkgreen")
- rozdzka_button = Button(screen, image=rozdzka_image, command=rozdzka_command)
- rozdzka_cost = Label(screen, text="Cost: -1 500 000\nClick power: +3930", bg="darkgreen")
- willa_button = Button(screen, image=willa_image, command=wila_comand)
- will_cost = Label(screen, text="Cost: -4 500 000\nClick power: +11 800", bg="darkgreen")
- wodka_button = Button(screen, image=wodka_image, command=wodka_command)
- wodka_cost = Label(screen, text="Cost: -10 000 000\nClick power: +25 000", bg="darkgreen")
- auto_button = Button(screen, image=auto_image, command=auto_command)
- auto_cost = Label(screen, text="Cost: -25 000 000\nClick power: +62 615", bg="darkgreen")
- wiedzmin_button = Button(screen, image=wiedzmin_image, command=wiedzmin_command)
- wiedzmin_cost = Label(screen, text="Cost: -75 000 000\nClick power: +187 850", bg="darkgreen")
- shiba_button = Button(screen, image=shiba_image, command=shiba_command)
- shiba_cost = Label(screen, text="Cost: -150 000 000\nClick power: +375 715", bg="darkgreen")
- marihuana_button = Button(screen, image=marihuana_image, command=marihuana_command)
- marihuana_cost = Label(screen, text="Cost: -500 000 000\nClick power: +1 500 000", bg="darkgreen")
- brazowa_skrzynia_button = Button(screen, image=brazowa_skrzynia_image, command=brazowa_skrzynia_command)
- brazowa_skrzynia_cost = Label(screen, text="Bronze Box\nCost: -50 000\nPrize: from 25 000 to 75 000 dogecoins", bg="brown")
- zlota_skrzynia_button = Button(screen, image=zlota_skrzynia_image, command=zlota_skrzynia_command)
- zlota_skrzynia_cost = Label(screen, text="Gold Box\nCost: -10 000 000\nPrize: from 2 500 000 to 17 500 000 dogecoins", bg="gold")
- diamentowa_skrzynia_button = Button(screen, image=diamentowa_skrzynia_image, command=diamentowa_skrzynia_command)
- diamentowa_skrzynia_cost = Label(screen, text="Diamond Box\nCost: -1 000 000 000\nPrize: from 100 000 000 to 1 900 000 000 dogecoins", bg="blue")
- button.grid(row=1, column=0)
- exit_button.grid(row=1, column=1)
- brazowa_skrzynia_button.grid(row=1, column=3)
- brazowa_skrzynia_cost.grid(row=0, column=3)
- zlota_skrzynia_button.grid(row=1, column=4)
- zlota_skrzynia_cost.grid(row=0, column=4)
- diamentowa_skrzynia_button.grid(row=1, column=5)
- diamentowa_skrzynia_cost.grid(row=0, column=5)
- wasy_button.grid(row=2, column=0)
- wasy_cost.grid(row=3, column=0)
- kapelusz_button.grid(row=4, column=0)
- kapelusz_cost.grid(row=5, column=0)
- puszka_button.grid(row=6, column=0)
- puszka_cost.grid(row=7, column=0)
- przysmak_button.grid(row=2, column=1)
- przysmak_cost.grid(row=3, column=1)
- kosc_button.grid(row=4, column=1)
- kosc_cost.grid(row=5, column=1)
- korona_button.grid(row=6, column=1)
- korona_cost.grid(row=7, column=1)
- piwo_button.grid(row=2, column=3)
- piwo_cost.grid(row=3, column=3)
- komputer_button.grid(row=4, column=3)
- komputer_cost.grid(row=5, column=3)
- rozdzka_button.grid(row=6, column=3)
- rozdzka_cost.grid(row=7, column=3)
- willa_button.grid(row=2, column=4)
- will_cost.grid(row=3, column=4)
- wodka_button.grid(row=4, column=4)
- wodka_cost.grid(row=5, column=4)
- auto_button.grid(row=6, column=4)
- auto_cost.grid(row=7, column=4)
- wiedzmin_button.grid(row=2, column=5)
- wiedzmin_cost.grid(row=3, column=5)
- shiba_button.grid(row=4, column=5)
- shiba_cost.grid(row=5, column=5)
- marihuana_button.grid(row=6, column=5)
- marihuana_cost.grid(row=7, column=5)
- if __name__ == '__main__':
- screen.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement