Repository navigation
Code cookie clicker
import tkinter from tkinter import * import sauvegarde as sl import time
#création d'une horloge pour avoir un "temps de jeu" def horloge(): global secondes global minutes global heures secondes += 1 time_s.after(1000, horloge) time_s.config(text = secondes) if secondes == 60: secondes = 0 minutes += 1 time_m.config(text = minutes) if minutes == 60: minutes = 0 heures += 1 time_h.config(text = heures)
#création d'une fonction chronomètre en millième de seconde #pour l'actualisation des étiquettes plus rapidement def fast_timer(): global fast_sec fast_sec += 1 fast_time.after(1, fast_timer) fast_time.config(text = fast_sec)
#définit la fonction chronomètre pourl'incrémentation du score chaque seconde def timer(): global sec global score sec += 1 time.after(1000, timer) time.config(text = sec)
# Variable boost cps
click_b = 1
cuisine_b = 1
magasin_b = 1
usine_b = 1
laboratoire_b = 1
multinationale_b = 1
terrecookie_b = 1
lunecookie_b = 1
systeme_b = 1
galaxie_b = 1
cookievers_b = 1
cookinfini_b = 1
total_b = 1
# Renommage des gains " classique " avec ajout de variables modifiant les cps
cuisine_p = (1*cuisine_b)
magasin_p = (5*magasin_b)
usine_p = (25*usine_b)
laboratoire_p = (50*laboratoire_b)
multinationale_p = (75*multinationale_b)
terrecookie_p = (110*terrecookie_b)
lunecookie_p = (150*lunecookie_b)
systeme_p = (225*systeme_b)
galaxie_p = (500*galaxie_b)
cookievers_p = (5000*cookievers_b)
cookinfini_p = (15000*cookinfini_b)
#met à jour les variables de score par seconde
global cuisine_s
cuisine_s = (cuisine_p * (x1-1))
global magasin_s
magasin_s = (magasin_p * (x2-1))
global usine_s
usine_s = (usine_p * (x3-1))
global laboratoire_s
laboratoire_s = ( laboratoire_p * (x4-1))
global multinationale_s
multinationale_s = (multinationale_p * (x5-1))
global terrecookie_s
terrecookie_s = ( terrecookie_p * ( x6-1))
global lunecookie_s
lunecookie_s = ( lunecookie_p*(x7-1))
global systeme_s
systeme_s = (systeme_p*(x8-1))
global galaxie_s
galaxie_s = (galaxie_p*(x9-1))
global cookievers_s
cookievers_s = ( cookievers_p * (x10-1))
global cookinfini_s
cookinfini_s = ( cookinfini_p * (x11-1))
#incrémente le score par seconde du bouton "cuisine"
if x1 >= 2:
score += cuisine_s
label_score.config(text = score)
#incrémente le score par seconde du bouton "magasin"
if x2 >= 2:
score += magasin_s
label_score.config(text = score)
#incrémente le score par seconde du bouton "usine"
if x3 >= 2:
score += usine_s
label_score.config(text = score)
#incrémente le score par seconde du bouton "laboratoire"
if x4 >= 2:
score += laboratoire_s
label_score.config(text = score)
#incrémente le score par seconde du bouton "multinationale"
if x5 >= 2:
score += multinationale_s
label_score.config(text = score)
#incrémente le score par seconde du bouton "Terre-cookie"
if x6 >= 2:
score += terrecookie_s
label_score.config(text = score)
#incrémente le score par seconde du bouton "Lune-cookie"
if x7 >= 2:
score += lunecookie_s
label_score.config(text = score)
#incrémente le score par seconde du bouton "Système solaire-cookie"
if x8 >= 2:
score += systeme_s
label_score.config(text = score)
#incrémente le score par seconde du bouton "galaxie-cookie"
if x9 >= 2:
score += galaxie_s
label_score.config(text = score)
#incrémente le score par seconde du bouton "cookivers"
if x10 >= 2:
score += cookievers_s
label_score.config(text = score)
#incrémente le score par seconde du bouton "cookinfini"
if x11 >= 2:
score += cookinfini_s
label_score.config(text = score)
#configure si le bouton d'amélioration du cookie est activé ou non
if score >= int(10 * 1.15**x):
a_click.config(state = NORMAL)
else:
a_click.config(state = DISABLED)
label_score.config(text = score)
c_click.config(text = int(10 * 1.15**x) )
#configure si le bouton "cuisine" est activé ou non
if score >= int(15 * 1.15**x1):
a_cuisine.config(state = NORMAL)
else:
a_cuisine.config(state = DISABLED)
#configure si le bouton "magasin" est activé ou non
if score >= int(50 * 1.15**x2):
a_magasin.config(state = NORMAL)
else:
a_magasin.config(state = DISABLED)
#configure si le bouton "usine" est activé ou non
if score >= int(150 * 1.15**x3):
a_usine.config(state = NORMAL)
else:
a_usine.config(state = DISABLED)
#configure si le bouton "laboratoire" est activé ou non
if score >= int(500 * 1.15**x4):
a_labo.config(state = NORMAL)
else:
a_labo.config(state = DISABLED)
#configure si le bouton "multinationale" est activé ou non
if score >= int(1500 * 1.15**x5):
a_multinatio.config(state = NORMAL)
else:
a_multinatio.config(state = DISABLED)
#configure si le bouton "Terre-cookie" est activé ou non
if score >= int(4550 * 1.15**x6):
a_terrecookie.config(state = NORMAL)
else:
a_terrecookie.config(state = DISABLED)
#configure si le bouton "Lune-cookie" est activé ou non
if score >= int(10000 * 1.15**x7):
a_lunecookie.config(state = NORMAL)
else:
a_lunecookie.config(state = DISABLED)
#configure si le bouton "Système solaire-cookie" est activé ou non
if score >= int(55500 * 1.15**x8):
a_systemecookie.config(state = NORMAL)
else:
a_systemecookie.config(state = DISABLED)
#configure si le bouton "galaxie-cookie" est activé ou non
if score >= int(1000000 * 1.15**x9):
a_galaxiecookie.config(state = NORMAL)
else:
a_galaxiecookie.config(state = DISABLED)
#configure si le bouton "cookivers" est activé ou non
if score >= int(100000000 * 1.15**x10):
a_cookivers.config(state = NORMAL)
else:
a_cookivers.config(state = DISABLED)
#configure si le bouton "cookinfini" est activé ou non
if score >= int(1000000000 * 1.15**x11):
a_cookinfini.config(state = NORMAL)
else:
a_cookinfini.config(state = DISABLED)
#met à jour l'étiquette du score
label_score.config(text = score)
#met à jour le nombre de cookies que l'on gagne par seconde
cookie_s = int((cuisine_s + magasin_s + usine_s + laboratoire_s + multinationale_s + terrecookie_s + lunecookie_s + systeme_s + galaxie_s + cookievers_s + cookinfini_s)*total_b)
label_cookie_s.config(text = cookie_s)
#met à jour l'étiquette c_click en cas de réinisialisation
c_click.config(text = int(10 * 1.15**x))
#met à jour l'étiquette c_cuisine en cas de réinisialisation
c_cuisine.config(text = int(15 * 1.15**x1))
#met à jour l'étiquette c_magasin en cas de réinisialisation
c_magasin.config(text = int(50 * 1.15**x2))
#met à jour l'étiquette c_usine en cas de réinisialisation
c_usine.config(text = int(150 * 1.15**x3))
#met à jour l'étiquette c_labo en cas de réinisialisation
c_labo.config(text = int(500 * 1.15**x4))
#met à jour l'étiquette c_multinatio en cas de réinisialisation
c_multinatio.config(text = int(1500 * 1.15**x5))
#met à jour l'étiquette c_terrecookie en cas de réinisialisation
c_terrecookie.config(text = int(4550 * 1.15**x6))
#met à jour l'étiquette c_lunecookie en cas de réinisialisation
c_lunecookie.config(text = int(10000 * 1.15**x7))
#met à jour l'étiquette c_systemecookie en cas de réinisialisation
c_systemecookie.config(text = int(55500 * 1.15**x8))
#met à jour l'étiquette c_galaxiecookie en cas de réinisialisation
c_galaxiecookie.config(text = int(1000000 * 1.15**x9))
#met à jour l'étiquette c_cookivers en cas de réinisialisation
c_cookivers.config(text = int(100000000 * 1.15**x10))
#met à jour l'étiquette c_cookinfini en cas de réinisialisation
c_cookinfini.config(text = int(1000000000 * 1.15**x11))
#création de la fonction d'incrémentation du score def add_score(): global score score += click label_score.config(text = score)
def a_cuisine(): label.config(text = 'amélioration cuisine')
def a_magasin(): label.config(text = 'amélioration magasin')
def a_usine(): label.config(text = 'amélioration usine')
def a_labo(): label.config(text = 'amélioration laboratoire')
def a_multinatio(): label.config(text = 'amélioration multinationale')
def a_terrecookie(): label.config(text = 'amélioration Terre-cookie')
def a_lunecookie(): label.config(text = 'amélioration Lune-cookie')
def a_systemecookie(): label.config(text = 'amélioration système solaire-cookie')
def a_galaxiecookie(): label.config(text = 'amélioration galaxie-cookie')
def a_cookivers(): label.config(text = 'amélioration cookivers')
def a_cookinfini(): label.config(text = 'amélioration cookinfini')
#création de la fonction d'amélioration du "cookie" def a_click(): global score global click global x click += 1 score -= int(10 * 1.15x) x += 1 if score >= int(10 * 1.15x): a_click.config(state = NORMAL) else: a_click.config(state = DISABLED) label_score.config(text = score) c_click.config(text = int(10 * 1.15**x))
#création de la fonction d'achat du bouton "cuisine" def a_cuisine(): global score global x1 score -= int(15 * 1.15x1) x1 += 1 if score >= int(15 * 1.15x1): a_cuisine.config(state = NORMAL) else: a_cuisine.config(state = DISABLED) label_score.config(text = score) c_cuisine.config(text = int(15 * 1.15**x1))
#création de la fonction d'achat du bouton "magasin" def a_magasin(): global score global x2 score -= int(50 * 1.15x2) x2 += 1 if score >= int(50 * 1.15x2): a_magasin.config(state = NORMAL) else: a_magasin.config(state = DISABLED) label_score.config(text = score) c_magasin.config(text = int(50 * 1.15**x2))
#création de la fonction d'achat du bouton "usine" def a_usine(): global score global x3 score -= int(150 * 1.15x3) x3 += 1 if score >= int(150 * 1.15x3): a_usine.config(state = NORMAL) else: a_usine.config(state = DISABLED) label_score.config(text = score) c_usine.config(text = int(150 * 1.15**x3))
#création de la fonction d'achat du bouton "laboratoire" def a_labo(): global score global x4 score -= int(500 * 1.15x4) x4 += 1 if score >= int(500 * 1.15x4): a_labo.config(state = NORMAL) else: a_labo.config(state = DISABLED) label_score.config(text = score) c_labo.config(text = int(500 * 1.15**x4))
#création de la fonction d'achat du bouton "multinationale" def a_multinatio(): global score global x5 score -= int(1500 * 1.15x5) x5 += 1 if score >= int(1500 * 1.15x5): a_multinatio.config(state = NORMAL) else: a_multinatio.config(state = DISABLED) label_score.config(text = score) c_multinatio.config(text = int(1500 * 1.15**x5))
#création de la fonction d'achat du bouton "Terre-cookie" def a_terrecookie(): global score global x6 score -= int(4550 * 1.15x6) x6 += 1 if score >= int(4550 * 1.15x6): a_terrecookie.config(state = NORMAL) else: a_terrecookie.config(state = DISABLED) label_score.config(text = score) c_terrecookie.config(text = int(4550 * 1.15**x6))
#création de la fonction d'achat du bouton "Lune-cookie" def a_lunecookie(): global score global x7 score -= int(10000 * 1.15x7) x7 += 1 if score >= int(10000 * 1.15x7): a_lunecookie.config(state = NORMAL) else: a_lunecookie.config(state = DISABLED) label_score.config(text = score) c_lunecookie.config(text = int(10000 * 1.15**x7))
#création de la fonction d'achat du bouton "Système solaire-cookie" def a_systemecookie(): global score global x8 score -= int(55500 * 1.15x8) x8 += 1 if score >= int(55500 * 1.15x8): a_systemecookie.config(state = NORMAL) else: a_systemecookie.config(state = DISABLED) label_score.config(text = score) c_systemecookie.config(text = int(55500 * 1.15**x8))
#création de la fonction d'achat du bouton "galaxie-cookie" def a_galaxiecookie(): global score global x9 score -= int(1000000 * 1.15x9) x9 += 1 if score >= int(1000000 * 1.15x9): a_galaxiecookie.config(state = NORMAL) else: a_galaxiecookie.config(state = DISABLED) label_score.config(text = score) c_galaxiecookie.config(text = int(1000000 * 1.15**x9))
#création de la fonction d'achat du bouton "cookivers" def a_cookivers(): global score global x10 score -= int(100000000 * 1.15x10) x10 += 1 if score >= int(100000000 * 1.15x10): a_cookivers.config(state = NORMAL) else: a_cookivers.config(state = DISABLED) label_score.config(text = score) c_cookivers.config(text = int(100000000 * 1.15**x10))
#création de la fonction d'achat du bouton "cookinfini" def a_cookinfini(): global score global x11 score -= int(1000000000 * 1.15x11) x11 += 1 if score >= int(1000000000 * 1.15x11): a_cookinfini.config(state = NORMAL) else: a_cookinfini.config(state = DISABLED) label_score.config(text = score) c_cookinfini.config(text = int(1000000000 * 1.15**x11))
#charge le score score = sl.load()
#charge le clique click = sl.load2()
#charge la variable x x = int(sl.load3())
#charge la variable x1 x1 = int(sl.load4())
#charge la variable x2 x2 = int(sl.load5())
#charge la variable x3 x3 = int(sl.load6())
#charge la variable x4 x4 = int(sl.load7())
#charge la variable x5 x5 = int(sl.load8())
#charge la variable x6 x6 = int(sl.load9())
#charge la variable x7 x7 = int(sl.load10())
#charge la variable x8 x8 = int(sl.load11())
#charge la variable x9 x9 = int(sl.load12())
#charge la variable x10 x10 = int(sl.load13())
#charge la variable x11 x11 = int(sl.load14())
#charge la variable secondes secondes = int(sl.load15())
#charge la variables minutes minutes = int(sl.load16())
#charge la variable heures heures = int(sl.load17())
#charge la variable de la couleur de la fenêtre principale bg_color = int(sl.load18())
#création de la fenêtre fen = tkinter.Tk()
#création du bouton "quitter"
quitter = tkinter.Button(fen,text = 'Quitter',height = 2, width = 12, bg = 'red',
command = fen.destroy)
quitter.grid(row = 16, column = 6)
label = tkinter.Label(fen, text = '...') label.grid(row = 1, column = 1)
#création de l'étiquette "heures" time_h = tkinter.Label(fen, text = heures) time_h.grid(row = 0, column = 7)
#création de l'étiquette "h" h = tkinter.Label(fen, text = "h") h.grid(row = 0, column = 8)
#création de l'étiquette "minutes" time_m = tkinter.Label(fen, text = minutes) time_m.grid(row = 0, column = 9)
#création de l'étiquette "min" mins = tkinter.Label(fen, text = 'min') mins.grid(row = 0, column = 10)
#création de l'étiquette "secondes" time_s = tkinter.Label(fen, text = secondes) time_s.grid(row = 0, column = 11)
#création de l'étiquette "s" s = tkinter.Label(fen, text = 's') s.grid(row = 0, column = 12)
#création de l'étiquette "score" label_score = tkinter.Label(fen,text=score) label_score.grid(row=0)
#création du coût du bouton d'amélioration du cookie c_click = tkinter.Label(fen, text = int(10 * 1.15**x), width = 48, height = 1) c_click.grid(row = 4, column = 3)
#création du coût du bouton "cuisine" c_cuisine = tkinter.Label(fen, text = int(15 * 1.15**x1), width = 48, height = 1) c_cuisine.grid(row = 5, column = 3)
#création du coût du bouton "magasin" c_magasin = tkinter.Label(fen, text = int(50 * 1.15**x2), width = 48, height = 1) c_magasin.grid(row = 6, column = 3)
#création du coût du bouton "usine" c_usine = tkinter.Label(fen, text = int(150 * 1.15**x3), width = 48, height = 1) c_usine.grid(row = 7, column = 3)
#création du coût du bouton "laboratoire" c_labo = tkinter.Label(fen, text = int(500 * 1.15**x4), width = 48, height = 1) c_labo.grid(row = 8, column = 3)
#création du coût du bouton "multinationale" c_multinatio = tkinter.Label(fen, text = int(1500 * 1.15**x5), width = 48, height = 1) c_multinatio.grid(row = 9, column = 3)
#création du coût du bouton "Terre-cookie" c_terrecookie = tkinter.Label(fen, text = int(4550 * 1.15**x6), width = 48, height = 1) c_terrecookie.grid(row = 10, column = 3)
#création du coût du bouton "Lune-cookie" c_lunecookie = tkinter.Label(fen, text = int(10000 * 1.15**x7), width = 48, height = 1) c_lunecookie.grid(row = 11, column = 3)
#définition du bouton "cookivers" d_cookivers = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 5 000', width = 48, height = 2) d_cookivers.grid(row = 14, column = 4)
#création du coût du bouton "Système solaire-cookie" c_systemecookie = tkinter.Label(fen, text = int(55500 * 1.15**x8), width = 48, height = 1) c_systemecookie.grid(row = 12, column = 3)
#création du coût du bouton "galaxie-cookie" c_galaxiecookie = tkinter.Label(fen, text = int(1000000 * 1.15**x9), width = 48, height = 1) c_galaxiecookie.grid(row = 13, column = 3)
#création du coût du bouton "cookivers" c_cookivers = tkinter.Label(fen, text = int(100000000 * 1.15**x10), width = 48, height = 1) c_cookivers.grid(row = 14, column = 3)
#création du coût du bouton "cookinfini" c_cookinfini = tkinter.Label(fen, text = int(1000000000 * 1.15**x11), width = 48, height = 1) c_cookinfini.grid(row = 15, column = 3)
#création du bouton "cookie" img_cookie = PhotoImage(file='cookie.jpg') bouton_cookie = tkinter.Button(fen, image = img_cookie, command = add_score) bouton_cookie.grid(row=1)
#création de l'étiquette "améliorations"
d_ameliorations = tkinter.Label(fen, text = 'améliorations :', bg = 'pink',
width = 32, height = 3)
d_ameliorations.grid(row = 2, column = 1)
#création du bouton d'amélioration du cookie
a_click = tkinter.Button(fen, text = 'améliorer le cookie', activebackground = 'cyan',
command = a_click, width = 32, height = 1)
a_click.grid(row = 4, column = 1)
#création du bouton "cuisine"
a_cuisine = tkinter.Button(fen, text = 'acheter une cuisine', activebackground = 'cyan',
command = a_cuisine, width = 32, height = 1)
a_cuisine.grid(row = 5, column = 1)
#création du bouton "magasin"
a_magasin = tkinter.Button(fen, text = 'acheter un magasin', activebackground = 'cyan',
command = a_magasin, width = 32, height = 1)
a_magasin.grid(row = 6, column = 1)
#création du bouton "usine"
a_usine = tkinter.Button(fen, text = 'acheter une usine', activebackground = 'cyan',
command = a_usine, width = 32, height = 1)
a_usine.grid(row = 7, column = 1)
#création d'un bouton "laboratoire"
a_labo = tkinter.Button(fen, text = 'acheter un laboratoire', activebackground = 'cyan',
command = a_labo, width = 32, height = 1)
a_labo.grid(row = 8, column = 1)
#création d'un bouton "multinationale"
a_multinatio = tkinter.Button(fen, text = 'acheter une multinationale', activebackground = 'cyan',
command = a_multinatio, width = 32, height = 1)
a_multinatio.grid(row = 9, column = 1)
#création d'un bouton "Terre-cookie"
a_terrecookie = tkinter.Button(fen, text = 'acheter une Terre-cookie', activebackground = 'cyan',
command = a_terrecookie, width = 32, height = 1)
a_terrecookie.grid(row = 10, column = 1)
#création d'un bouton "Lune-cookie"
a_lunecookie = tkinter.Button(fen, text = 'acheter une Lune-cookie', activebackground = 'cyan',
command = a_lunecookie, width = 32, height = 1)
a_lunecookie.grid(row = 11, column = 1)
#création d'un bouton "système solaire-cookie"
a_systemecookie = tkinter.Button(fen, text = 'acheter un système solaire-cookie', activebackground = 'cyan',
command = a_systemecookie, width = 32, height = 1)
a_systemecookie.grid(row = 12, column = 1)
#création d'un bouton "galaxie-cookie"
a_galaxiecookie = tkinter.Button(fen, text = 'acheter une galaxie-cookie', activebackground = 'cyan',
command = a_galaxiecookie, width = 32, height = 1)
a_galaxiecookie.grid(row = 13, column = 1)
#création d'un bouton "cookievers"
a_cookivers = tkinter.Button(fen, text = 'acheter un cookievers', activebackground = 'cyan',
command = a_cookivers, width = 32, height = 1)
a_cookivers.grid(row = 14, column = 1)
#création d'un bouton "cookinfini"
a_cookinfini = tkinter.Button(fen, text = 'acheter un cookinfini', activebackground = 'cyan',
command = a_cookinfini, width = 32, height = 1)
a_cookinfini.grid(row = 15, column = 1)
#création de l'étiquette "coût" cout = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout.grid(row = 4, column = 2)
cout2 = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout2.grid(row = 5, column = 2)
cout3 = tkinter.Label(text =' coût :', width = 16, height = 1, bg = 'pink') cout3.grid(row = 6, column = 2)
cout4 = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout4.grid(row = 7, column = 2)
cout5 = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout5.grid(row = 8, column = 2)
cout6 = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout6.grid(row = 9, column = 2)
cout7 = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout7.grid(row = 10, column = 2)
cout8 = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout8.grid(row = 11, column = 2)
cout9 = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout9.grid(row = 12, column = 2)
cout10 = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout10.grid(row = 13, column = 2)
cout11 = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout11.grid(row = 14, column = 2)
cout12 = tkinter.Label(text = ' coût :', width = 16, height = 1, bg = 'pink') cout12.grid(row = 15, column = 2)
#création de l'étiquette "définitions"
d_definitions = tkinter.Label(fen, text = 'Définitions des améliorations :', bg = 'pink',
width = 48, height = 3)
d_definitions.grid(row = 2, column = 4)
#définition de l'amélioration du clique d_click = tkinter.Label(fen, text = 'Incrémente le cookie de 1', width = 48, height = 2) d_click.grid(row = 4, column = 4)
#définition du bouton "cuisine" d_cuisine = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 1', width = 48, height = 2) d_cuisine.grid(row = 5, column = 4)
#définition du bouton "magasin" d_magasin = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 5', width = 48, height = 2) d_magasin.grid(row = 6, column = 4)
#définition du bouton "usine" d_usine = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 25', width = 48, height = 2) d_usine.grid(row = 7, column = 4)
#définition du bouton "laboratoire" d_labo = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 50', width = 48, height = 2) d_labo.grid(row = 8, column = 4)
#définition du bouton "multinationale" d_multinatio = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 75', width = 48, height = 2) d_multinatio.grid(row = 9, column = 4)
#définition du bouton "Terre-cookie" d_terrecookie = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 110', width = 48, height = 2) d_terrecookie.grid(row = 10, column = 4)
#définition du bouton "Lune-cookie" d_lunecookie = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 150', width = 48, height = 2) d_lunecookie.grid(row = 11, column = 4)
#définition du bouton "système solaire-cookie" d_systemecookie = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 225', width = 48, height = 2) d_systemecookie.grid(row = 12, column = 4)
#définition du bouton "galaxie-cookie" d_galaxiecookie = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 500', width = 48, height = 2) d_galaxiecookie.grid(row = 13, column = 4)
#définition du bouton "cookivers" d_cookivers = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 5 000', width = 48, height = 2) d_cookivers.grid(row = 14, column = 4)
#définition du bouton "cookinfini" d_cookinfini = tkinter.Label(fen, text = 'Augmente les cookies par seconde de 15 000', width = 48, height = 2) d_cookinfini.grid(row = 15, column = 4)
#création de l'étiquette "cookies gagnés par seconde" def_label_cookie_s = tkinter.Label(fen, text = "cookie gagnés par seconde : ") def_label_cookie_s.grid(row = 0, column = 1)
click_b = 1 cuisine_b = 1 magasin_b = 1 usine_b = 1 laboratoire_b = 1 multinationale_b = 1 terrecookie_b = 1 lunecookie_b = 1 systeme_b = 1 galaxie_b = 1 cookievers_b = 1 cookinfini_b = 1 total_b = 1
cuisine_p = (1cuisine_b) magasin_p = (5magasin_b) usine_p = (25usine_b) laboratoire_p = (50laboratoire_b) multinationale_p = (75multinationale_b) terrecookie_p = (110terrecookie_b) lunecookie_p = (150lunecookie_b) systeme_p = (225systeme_b) galaxie_p = (500galaxie_b) cookievers_p = (5000cookievers_b) cookinfini_p = (15000*cookinfini_b)
cuisine_s = (cuisine_p * (x1-1)) magasin_s = (magasin_p * (x2-1)) usine_s = (usine_p * (x3-1)) laboratoire_s = ( laboratoire_p * (x4-1)) multinationale_s = (multinationale_p * (x5-1)) terrecookie_s = ( terrecookie_p * ( x6-1)) lunecookie_s = ( lunecookie_p*(x7-1)) systeme_s = (systeme_p*(x8-1)) galaxie_s = (galaxie_p*(x9-1)) cookievers_s = ( cookievers_p * (x10-1)) cookinfini_s = ( cookinfini_p * (x11-1))
#création du nombre de cookies par secondes cookie_s = int((cuisine_s + magasin_s + usine_s + laboratoire_s + multinationale_s + terrecookie_s + lunecookie_s + systeme_s + galaxie_s + cookievers_s + cookinfini_s)*total_b) label_cookie_s = tkinter.Label(fen, text = cookie_s) label_cookie_s.grid(row = 0, column = 2)
#création de la fonction pour afficher les trophées
def trophees():
fen.withdraw()
fen2 = tkinter.Tk()
fen2.configure(background = 'pink')
#création du trophee "améliorer le cookie une fois"
trophee_cookiex1 = tkinter.Button(fen2, text = "améliorer une fois le cookie", bg = 'green', width = 32, height = 2)
trophee_cookiex1.grid(row = 0, column = 0)
#création du trophee "acheter une cuisine"
trophee_cuisinex1 = tkinter.Button(fen2, text = "acheter une cuisine", bg = 'green', width = 32, height = 2)
trophee_cuisinex1.grid(row = 1, column = 0)
#création du trophee "acheter un magasin"
trophee_magasinx1 = tkinter.Button(fen2, text = "acheter un magasin", bg = 'green', width = 32, height = 2)
trophee_magasinx1.grid(row = 2, column = 0)
#création du trophee "acheter une usine"
trophee_usinex1 = tkinter.Button(fen2, text = "acheter une usine", bg = 'green', width = 32, height = 2)
trophee_usinex1.grid(row = 3, column = 0)
#création du trophee "acheter un labo"
trophee_labox1 = tkinter.Button(fen2, text = "acheter un laboratoire", bg = 'green', width = 32, height = 2)
trophee_labox1.grid(row = 4, column = 0)
#création du trophee "acheter une multinationale"
trophee_multinatiox1 = tkinter.Button(fen2, text = "acheter une multinaionale", bg = 'green', width = 32, height = 2)
trophee_multinatiox1.grid(row = 5, column = 0)
#création du trophee "acheter une Terre_cookie"
trophee_terrecookiex1 = tkinter.Button(fen2, text = "acheter une Terre-cookie", bg = 'green', width = 32, height = 2)
trophee_terrecookiex1.grid(row = 6, column = 0)
#création du trophee "acheter une Lune-cookie"
trophee_lunecookiex1 = tkinter.Button(fen2, text = "acheter une Lune-cookie", bg = 'green', width = 32, height = 2)
trophee_lunecookiex1.grid(row = 7, column = 0)
#création du trophee "acheter un systeme solaire-cookie"
trophee_systemecookiex1 = tkinter.Button(fen2, text = "acheter un système solaire-cookie", bg = 'green', width = 32, height = 2)
trophee_systemecookiex1.grid(row = 8, column = 0)
#création du trophee "acheter une galaxie-cookie"
trophee_galaxiecookiex1 = tkinter.Button(fen2, text = "acheter une galaxie-cookie", bg = 'green', width = 32, height = 2)
trophee_galaxiecookiex1.grid(row = 9, column = 0)
#création du trophee "acheter un cookivers"
trophee_cookiversx1 = tkinter.Button(fen2, text = "acheter un cookivers", bg = 'green', width = 32, height = 2)
trophee_cookiversx1.grid(row = 10, column = 0)
#création du trophee "acheter un cookinfini"
trophee_cookinfinix1 = tkinter.Button(fen2, text = "acheter un cookinfini", bg = 'green', width = 32, height = 2)
trophee_cookinfinix1.grid(row = 11, column = 0)
#création du trophee "améliorer le cookie 10 fois"
trophee_cookiex10 = tkinter.Button(fen2, text = "améliorer dix fois le cookie", bg = 'green', width = 32, height = 2)
trophee_cookiex10.grid(row = 0,column = 1)
#création du trophee "acheter 10 cuisine"
trophee_cuisinex10 = tkinter.Button(fen2, text = "acheter dix cuisines", bg = 'green', width = 32, height = 2)
trophee_cuisinex10.grid(row = 1,column = 1)
#création du trophee "acheter 10 magasin"
trophee_magasinx10 = tkinter.Button(fen2, text = "acheter dix magasins", bg = 'green', width = 32, height = 2)
trophee_magasinx10.grid(row = 2,column = 1)
#création du trophee "acheter 10 usine"
trophee_usinex10 = tkinter.Button(fen2, text = "acheter dix usines", bg = 'green', width = 32, height = 2)
trophee_usinex10.grid(row = 3,column = 1)
#création du trophee "acheter 10 labo"
trophee_labox10 = tkinter.Button(fen2, text = "acheter dix laboratoires", bg = 'green', width = 32, height = 2)
trophee_labox10.grid(row = 4,column = 1)
#création du trophee "acheter 10 multinationale"
trophee_multinatiox10 = tkinter.Button(fen2, text = "acheter dix multinaionales", bg = 'green', width = 32, height = 2)
trophee_multinatiox10.grid(row = 5,column = 1)
#création du trophee "acheter 10 Terre_cookie"
trophee_terrecookiex10 = tkinter.Button(fen2, text = "acheter dix Terre-cookies", bg = 'green', width = 32, height = 2)
trophee_terrecookiex10.grid(row = 6,column = 1)
#création du trophee "acheter 10 Lune-cookie"
trophee_lunecookiex10 = tkinter.Button(fen2, text = "acheter dix Lune-cookies", bg = 'green', width = 32, height = 2)
trophee_lunecookiex10.grid(row = 7,column = 1)
#création du trophee "acheter 10 systeme solaire-cookie"
trophee_systemecookiex10 = tkinter.Button(fen2, text = "acheter dix système solaire-cookies", bg = 'green', width = 32, height = 2)
trophee_systemecookiex10.grid(row = 8,column = 1)
#création du trophee "acheter 10 galaxie-cookie"
trophee_galaxiecookiex10 = tkinter.Button(fen2, text = "acheter dix galaxie-cookies", bg = 'green', width = 32, height = 2)
trophee_galaxiecookiex10.grid(row = 9,column = 1)
#création du trophee "acheter 10 cookivers"
trophee_cookiversx10 = tkinter.Button(fen2, text = "acheter dix cookivers", bg = 'green', width = 32, height = 2)
trophee_cookiversx10.grid(row = 10,column = 1)
#création du trophee "acheter 10 cookinfini"
trophee_cookinfinix10 = tkinter.Button(fen2, text = "acheter dix cookinfinis", bg = 'green', width = 32, height = 2)
trophee_cookinfinix10.grid(row = 11,column = 1)
#création du trophee "améliorer le cookie 50 fois"
trophee_cookiex50 = tkinter.Button(fen2, text = "améliorer cinquante fois le cookie", bg = 'green', width = 32, height = 2)
trophee_cookiex50.grid(row = 0,column = 2)
#création du trophee "acheter 50 cuisine"
trophee_cuisinex50 = tkinter.Button(fen2, text = "acheter cinquante cuisines", bg = 'green', width = 32, height = 2)
trophee_cuisinex50.grid(row = 1,column = 2)
#création du trophee "acheter 50 magasin"
trophee_magasinx50 = tkinter.Button(fen2, text = "acheter cinquante magasins", bg = 'green', width = 32, height = 2)
trophee_magasinx50.grid(row = 2,column = 2)
#création du trophee "acheter 50 usine"
trophee_usinex50 = tkinter.Button(fen2, text = "acheter cinquante usines", bg = 'green', width = 32, height = 2)
trophee_usinex50.grid(row = 3,column = 2)
#création du trophee "acheter 50 labo"
trophee_labox50 = tkinter.Button(fen2, text = "acheter cinquante laboratoires", bg = 'green', width = 32, height = 2)
trophee_labox50.grid(row = 4,column = 2)
#création du trophee "acheter 50 multinationale"
trophee_multinatiox50 = tkinter.Button(fen2, text = "acheter cinquante multinaionales", bg = 'green', width = 32, height = 2)
trophee_multinatiox50.grid(row = 5,column = 2)
#création du trophee "acheter 50 Terre_cookie"
trophee_terrecookiex50 = tkinter.Button(fen2, text = "acheter cinquante Terre-cookies", bg = 'green', width = 32, height = 2)
trophee_terrecookiex50.grid(row = 6,column = 2)
#création du trophee "acheter 50 Lune-cookie"
trophee_lunecookiex50 = tkinter.Button(fen2, text = "acheter cinquante Lune-cookies", bg = 'green', width = 32, height = 2)
trophee_lunecookiex50.grid(row = 7,column = 2)
#création du trophee "acheter 50 systeme solaire-cookie"
trophee_systemecookiex50 = tkinter.Button(fen2, text = "acheter cinquante système solaire-cookies", bg = 'green', width = 32, height = 2)
trophee_systemecookiex50.grid(row = 8,column = 2)
#création du trophee "acheter 50 galaxie-cookie"
trophee_galaxiecookiex50 = tkinter.Button(fen2, text = "acheter cinquante galaxie-cookies", bg = 'green', width = 32, height = 2)
trophee_galaxiecookiex50.grid(row = 9,column = 2)
#création du trophee "acheter 50 cookivers"
trophee_cookiversx50 = tkinter.Button(fen2, text = "acheter cinquante cookivers", bg = 'green', width = 32, height = 2)
trophee_cookiversx50.grid(row = 10,column = 2)
#création du trophee "acheter 50 cookinfini"
trophee_cookinfinix50 = tkinter.Button(fen2, text = "acheter cinquante cookinfinis", bg = 'green', width = 32, height = 2)
trophee_cookinfinix50.grid(row = 11,column = 2)
#création du trophee "améliorer le cookie 100 fois"
trophee_cookiex100 = tkinter.Button(fen2, text = "améliorer cent fois le cookies", bg = 'green', width = 32, height = 2)
trophee_cookiex100.grid(row = 0,column = 3)
#création du trophee "acheter 100 cuisine"
trophee_cuisinex100 = tkinter.Button(fen2, text = "acheter cent cuisines", bg = 'green', width = 32, height = 2)
trophee_cuisinex100.grid(row = 1,column = 3)
#création du trophee "acheter 100 magasin"
trophee_magasinx100 = tkinter.Button(fen2, text = "acheter cent magasins", bg = 'green', width = 32, height = 2)
trophee_magasinx100.grid(row = 2,column = 3)
#création du trophee "acheter 100 usine"
trophee_usinex100 = tkinter.Button(fen2, text = "acheter cent usines", bg = 'green', width = 32, height = 2)
trophee_usinex100.grid(row = 3,column = 3)
#création du trophee "acheter 100 labo"
trophee_labox100 = tkinter.Button(fen2, text = "acheter cent laboratoires", bg = 'green', width = 32, height = 2)
trophee_labox100.grid(row = 4,column = 3)
#création du trophee "acheter 100 multinationale"
trophee_multinatiox100 = tkinter.Button(fen2, text = "acheter cent multinaionales", bg = 'green', width = 32, height = 2)
trophee_multinatiox100.grid(row = 5,column = 3)
#création du trophee "acheter 100 Terre_cookie"
trophee_terrecookiex100 = tkinter.Button(fen2, text = "acheter cent Terre-cookies", bg = 'green', width = 32, height = 2)
trophee_terrecookiex100.grid(row = 6,column = 3)
#création du trophee "acheter 100 Lune-cookie"
trophee_lunecookiex100 = tkinter.Button(fen2, text = "acheter cent Lune-cookies", bg = 'green', width = 32, height = 2)
trophee_lunecookiex100.grid(row = 7,column = 3)
#création du trophee "acheter 100 systeme solaire-cookie"
trophee_systemecookiex100 = tkinter.Button(fen2, text = "acheter cent système solaire-cookies", bg = 'green', width = 32, height = 2)
trophee_systemecookiex100.grid(row = 8,column = 3)
#création du trophee "acheter 100 galaxie-cookie"
trophee_galaxiecookiex100 = tkinter.Button(fen2, text = "acheter cent galaxie-cookies", bg = 'green', width = 32, height = 2)
trophee_galaxiecookiex100.grid(row = 9,column = 3)
#création du trophee "acheter 100 cookivers"
trophee_cookiversx100 = tkinter.Button(fen2, text = "acheter cent cookivers", bg = 'green', width = 32, height = 2)
trophee_cookiversx100.grid(row = 10,column = 3)
#création du trophee "acheter 100 cookinfini"
trophee_cookinfinix100 = tkinter.Button(fen2, text = "acheter cent cookinfinis", bg = 'green', width = 32, height = 2)
trophee_cookinfinix100.grid(row = 11,column = 3)
#création du trophee "améliorer le cookie 500 fois"
trophee_cookiex500 = tkinter.Button(fen2, text = "améliorer cinq-cent fois le cookies", bg = 'green', width = 32, height = 2)
trophee_cookiex500.grid(row = 0,column = 4)
#création du trophee "acheter 500 cuisine"
trophee_cuisinex500 = tkinter.Button(fen2, text = "acheter cinq-cent cuisines", bg = 'green', width = 32, height = 2)
trophee_cuisinex500.grid(row = 1,column = 4)
#création du trophee "acheter 500 magasin"
trophee_magasinx500 = tkinter.Button(fen2, text = "acheter cinq-cent magasins", bg = 'green', width = 32, height = 2)
trophee_magasinx500.grid(row = 2,column = 4)
#création du trophee "acheter 500 usine"
trophee_usinex500 = tkinter.Button(fen2, text = "acheter cinq-cent usines", bg = 'green', width = 32, height = 2)
trophee_usinex500.grid(row = 3,column = 4)
#création du trophee "acheter 500 labo"
trophee_labox500 = tkinter.Button(fen2, text = "acheter cinq-cent laboratoires", bg = 'green', width = 32, height = 2)
trophee_labox500.grid(row = 4,column = 4)
#création du trophee "acheter 500 multinationale"
trophee_multinatiox500 = tkinter.Button(fen2, text = "acheter cinq-cent multinaionales", bg = 'green', width = 32, height = 2)
trophee_multinatiox500.grid(row = 5,column = 4)
#création du trophee "acheter 500 Terre_cookie"
trophee_terrecookiex500 = tkinter.Button(fen2, text = "acheter cinq-cent Terre-cookies", bg = 'green', width = 32, height = 2)
trophee_terrecookiex500.grid(row = 6,column = 4)
#création du trophee "acheter 500 Lune-cookie"
trophee_lunecookiex500 = tkinter.Button(fen2, text = "acheter cinq-cent Lune-cookies", bg = 'green', width = 32, height = 2)
trophee_lunecookiex500.grid(row = 7,column = 4)
#création du trophee "acheter 500 systeme solaire-cookie"
trophee_systemecookiex500 = tkinter.Button(fen2, text = "acheter cinq-cent système solaire-cookies", bg = 'green', width = 32, height = 2)
trophee_systemecookiex500.grid(row = 8,column = 4)
#création du trophee "acheter 500 galaxie-cookie"
trophee_galaxiecookiex500 = tkinter.Button(fen2, text = "acheter cinq-cent galaxie-cookies", bg = 'green', width = 32, height = 2)
trophee_galaxiecookiex500.grid(row = 9,column = 4)
#création du trophee "acheter 500 cookivers"
trophee_cookiversx500 = tkinter.Button(fen2, text = "acheter cinq-cent cookivers", bg = 'green', width = 32, height = 2)
trophee_cookiversx500.grid(row = 10,column = 4)
#création du trophee "acheter 500 cookinfini"
trophee_cookinfinix500 = tkinter.Button(fen2, text = "acheter cinq-cent cookinfinis", bg = 'green', width = 32, height = 2)
trophee_cookinfinix500.grid(row = 11,column = 4)
#création du trophee "améliorer le cookie 1000 fois"
trophee_cookiex1000 = tkinter.Button(fen2, text = "améliorer mille fois le cookies", bg = 'green', width = 32, height = 2)
trophee_cookiex1000.grid(row = 0,column = 5)
#création du trophee "acheter 1000 cuisine"
trophee_cuisinex1000 = tkinter.Button(fen2, text = "acheter mille cuisines", bg = 'green', width = 32, height = 2)
trophee_cuisinex1000.grid(row = 1,column = 5)
#création du trophee "acheter 1000 magasin"
trophee_magasinx1000 = tkinter.Button(fen2, text = "acheter mille magasins", bg = 'green', width = 32, height = 2)
trophee_magasinx1000.grid(row = 2,column = 5)
#création du trophee "acheter 1000 usine"
trophee_usinex1000 = tkinter.Button(fen2, text = "acheter mille usines", bg = 'green', width = 32, height = 2)
trophee_usinex1000.grid(row = 3,column = 5)
#création du trophee "acheter 1000 labo"
trophee_labox1000 = tkinter.Button(fen2, text = "acheter mille laboratoires", bg = 'green', width = 32, height = 2)
trophee_labox1000.grid(row = 4,column = 5)
#création du trophee "acheter 1000 multinationale"
trophee_multinatiox1000 = tkinter.Button(fen2, text = "acheter mille multinaionales", bg = 'green', width = 32, height = 2)
trophee_multinatiox1000.grid(row = 5,column = 5)
#création du trophee "acheter 1000 Terre_cookie"
trophee_terrecookiex1000 = tkinter.Button(fen2, text = "acheter mille Terre-cookies", bg = 'green', width = 32, height = 2)
trophee_terrecookiex1000.grid(row = 6,column = 5)
#création du trophee "acheter 1000 Lune-cookie"
trophee_lunecookiex1000 = tkinter.Button(fen2, text = "acheter mille Lune-cookies", bg = 'green', width = 32, height = 2)
trophee_lunecookiex1000.grid(row = 7,column = 5)
#création du trophee "acheter 1000 systeme solaire-cookie"
trophee_systemecookiex1000 = tkinter.Button(fen2, text = "acheter mille système solaire-cookies", bg = 'green', width = 32, height = 2)
trophee_systemecookiex1000.grid(row = 8,column = 5)
#création du trophee "acheter 1000 galaxie-cookie"
trophee_galaxiecookiex1000 = tkinter.Button(fen2, text = "acheter mille galaxie-cookies", bg = 'green', width = 32, height = 2)
trophee_galaxiecookiex1000.grid(row = 9,column = 5)
#création du trophee "acheter 1000 cookivers"
trophee_cookiversx1000 = tkinter.Button(fen2, text = "acheter mille cookivers", bg = 'green', width = 32, height = 2)
trophee_cookiversx1000.grid(row = 10,column = 5)
#création du trophee "acheter 1000 cookinfini"
trophee_cookinfinix1000 = tkinter.Button(fen2, text = "acheter mille cookinfinis", bg = 'green', width = 32, height = 2)
trophee_cookinfinix1000.grid(row = 11,column = 5)
#création d'un chronometre dans la seconde fenêtre
sec2 = 0
def timer2():
global sec2
sec2 += 1
time.after(1000, timer)
#configure si le bouton trophee "améliorer le cookie une fois" est activé ou non
if x >= 2:
trophee_cookiex1.config(state = NORMAL)
else:
trophee_cookiex1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter une cuisine" est activé ou non
if x1 >= 2:
trophee_cuisinex1.config(state = NORMAL)
else:
trophee_cuisinex1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter un magasin" est activé ou non
if x2 >= 2:
trophee_magasinx1.config(state = NORMAL)
else:
trophee_magasinx1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter une usine" est activé ou non
if x3 >= 2:
trophee_usinex1.config(state = NORMAL)
else:
trophee_usinex1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter un laboratoire" est activé ou non
if x4 >= 2:
trophee_labox1.config(state = NORMAL)
else:
trophee_labox1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter une multinationale" est activé ou non
if x5 >= 2:
trophee_multinatiox1.config(state = NORMAL)
else:
trophee_multinatiox1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter une Terre-cookie" est activé ou non
if x6 >= 2:
trophee_terrecookiex1.config(state = NORMAL)
else:
trophee_terrecookiex1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter une Lune-cookie" est activé ou non
if x7 >= 2:
trophee_lunecookiex1.config(state = NORMAL)
else:
trophee_lunecookiex1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter un système solaire-cookie" est activé ou non
if x8 >= 2:
trophee_systemecookiex1.config(state = NORMAL)
else:
trophee_systemecookiex1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter une galaxie-cookie" est activé ou non
if x9 >= 2:
trophee_galaxiecookiex1.config(state = NORMAL)
else:
trophee_galaxiecookiex1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter un cookivers" est activé ou non
if x10 >= 2:
trophee_cookiversx1.config(state = NORMAL)
else:
trophee_cookiversx1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter un cookinfini" est activé ou non
if x11 >= 2:
trophee_cookinfinix1.config(state = NORMAL)
else:
trophee_cookinfinix1.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "améliorer le cookie 10 fois" est activé ou non
if x >= 11:
trophee_cookiex10.config(state = NORMAL)
else:
trophee_cookiex10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 cuisines" est activé ou non
if x1 >= 11:
trophee_cuisinex10.config(state = NORMAL)
else:
trophee_cuisinex10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 magasins" est activé ou non
if x2 >= 11:
trophee_magasinx10.config(state = NORMAL)
else:
trophee_magasinx10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 usines" est activé ou non
if x3 >= 11:
trophee_usinex10.config(state = NORMAL)
else:
trophee_usinex10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 laboratoires" est activé ou non
if x4 >= 11:
trophee_labox10.config(state = NORMAL)
else:
trophee_labox10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 multinationales" est activé ou non
if x5 >= 11:
trophee_multinatiox10.config(state = NORMAL)
else:
trophee_multinatiox10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 Terre-cookie" est activé ou non
if x6 >= 11:
trophee_terrecookiex10.config(state = NORMAL)
else:
trophee_terrecookiex10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 Lune-cookie" est activé ou non
if x7 >= 11:
trophee_lunecookiex10.config(state = NORMAL)
else:
trophee_lunecookiex10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 système solaire-cookie" est activé ou non
if x8 >= 11:
trophee_systemecookiex10.config(state = NORMAL)
else:
trophee_systemecookiex10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 galaxie-cookie" est activé ou non
if x9 >= 11:
trophee_galaxiecookiex10.config(state = NORMAL)
else:
trophee_galaxiecookiex10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 cookivers" est activé ou non
if x10 >= 11:
trophee_cookiversx10.config(state = NORMAL)
else:
trophee_cookiversx10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 10 cookinfini" est activé ou non
if x11 >= 11:
trophee_cookinfinix10.config(state = NORMAL)
else:
trophee_cookinfinix10.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "améliorer le cookie 50 fois" est activé ou non
if x >= 51:
trophee_cookiex50.config(state = NORMAL)
else:
trophee_cookiex50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 cuisines" est activé ou non
if x1 >= 51:
trophee_cuisinex50.config(state = NORMAL)
else:
trophee_cuisinex50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 magasins" est activé ou non
if x2 >= 51:
trophee_magasinx50.config(state = NORMAL)
else:
trophee_magasinx50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 usines" est activé ou non
if x3 >= 51:
trophee_usinex50.config(state = NORMAL)
else:
trophee_usinex50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 laboratoires" est activé ou non
if x4 >= 51:
trophee_labox50.config(state = NORMAL)
else:
trophee_labox50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 multinationales" est activé ou non
if x5 >= 51:
trophee_multinatiox50.config(state = NORMAL)
else:
trophee_multinatiox50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 Terre-cookie" est activé ou non
if x6 >= 51:
trophee_terrecookiex50.config(state = NORMAL)
else:
trophee_terrecookiex50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 Lune-cookie" est activé ou non
if x7 >= 51:
trophee_lunecookiex50.config(state = NORMAL)
else:
trophee_lunecookiex50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 système solaire-cookie" est activé ou non
if x8 >= 51:
trophee_systemecookiex50.config(state = NORMAL)
else:
trophee_systemecookiex50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 galaxie-cookie" est activé ou non
if x9 >= 51:
trophee_galaxiecookiex50.config(state = NORMAL)
else:
trophee_galaxiecookiex50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 cookivers" est activé ou non
if x10 >= 51:
trophee_cookiversx50.config(state = NORMAL)
else:
trophee_cookiversx50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 50 cookinfini" est activé ou non
if x11 >= 51:
trophee_cookinfinix50.config(state = NORMAL)
else:
trophee_cookinfinix50.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "améliorer le cookie 100 fois" est activé ou non
if x >= 101:
trophee_cookiex100.config(state = NORMAL)
else:
trophee_cookiex100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 cuisines" est activé ou non
if x1 >= 101:
trophee_cuisinex100.config(state = NORMAL)
else:
trophee_cuisinex100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 magasins" est activé ou non
if x2 >= 101:
trophee_magasinx100.config(state = NORMAL)
else:
trophee_magasinx100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 usines" est activé ou non
if x3 >= 101:
trophee_usinex100.config(state = NORMAL)
else:
trophee_usinex100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 laboratoires" est activé ou non
if x4 >= 101:
trophee_labox100.config(state = NORMAL)
else:
trophee_labox100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 multinationales" est activé ou non
if x5 >= 101:
trophee_multinatiox100.config(state = NORMAL)
else:
trophee_multinatiox100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 Terre-cookie" est activé ou non
if x6 >= 101:
trophee_terrecookiex100.config(state = NORMAL)
else:
trophee_terrecookiex100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 Lune-cookie" est activé ou non
if x7 >= 101:
trophee_lunecookiex100.config(state = NORMAL)
else:
trophee_lunecookiex100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 système solaire-cookie" est activé ou non
if x8 >= 101:
trophee_systemecookiex100.config(state = NORMAL)
else:
trophee_systemecookiex100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 galaxie-cookie" est activé ou non
if x9 >= 101:
trophee_galaxiecookiex100.config(state = NORMAL)
else:
trophee_galaxiecookiex100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 cookivers" est activé ou non
if x10 >= 101:
trophee_cookiversx100.config(state = NORMAL)
else:
trophee_cookiversx100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 100 cookinfini" est activé ou non
if x11 >= 101:
trophee_cookinfinix100.config(state = NORMAL)
else:
trophee_cookinfinix100.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "améliorer le cookie 500 fois" est activé ou non
if x >= 501:
trophee_cookiex500.config(state = NORMAL)
else:
trophee_cookiex500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 cuisines" est activé ou non
if x1 >= 501:
trophee_cuisinex500.config(state = NORMAL)
else:
trophee_cuisinex500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 magasins" est activé ou non
if x2 >= 501:
trophee_magasinx500.config(state = NORMAL)
else:
trophee_magasinx500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 usines" est activé ou non
if x3 >= 501:
trophee_usinex500.config(state = NORMAL)
else:
trophee_usinex500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 laboratoires" est activé ou non
if x4 >= 501:
trophee_labox500.config(state = NORMAL)
else:
trophee_labox500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 multinationales" est activé ou non
if x5 >= 501:
trophee_multinatiox500.config(state = NORMAL)
else:
trophee_multinatiox500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 Terre-cookie" est activé ou non
if x6 >= 501:
trophee_terrecookiex500.config(state = NORMAL)
else:
trophee_terrecookiex500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 Lune-cookie" est activé ou non
if x7 >= 501:
trophee_lunecookiex500.config(state = NORMAL)
else:
trophee_lunecookiex500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 système solaire-cookie" est activé ou non
if x8 >= 501:
trophee_systemecookiex500.config(state = NORMAL)
else:
trophee_systemecookiex500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 galaxie-cookie" est activé ou non
if x9 >= 501:
trophee_galaxiecookiex500.config(state = NORMAL)
else:
trophee_galaxiecookiex500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 cookivers" est activé ou non
if x10 >= 501:
trophee_cookiversx500.config(state = NORMAL)
else:
trophee_cookiversx500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 500 cookinfini" est activé ou non
if x11 >= 501:
trophee_cookinfinix500.config(state = NORMAL)
else:
trophee_cookinfinix500.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "améliorer le cookie 1000 fois" est activé ou non
if x >= 1001:
trophee_cookiex1000.config(state = NORMAL)
else:
trophee_cookiex1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 cuisines" est activé ou non
if x1 >= 1001:
trophee_cuisinex1000.config(state = NORMAL)
else:
trophee_cuisinex1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 magasins" est activé ou non
if x2 >= 1001:
trophee_magasinx1000.config(state = NORMAL)
else:
trophee_magasinx1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 usines" est activé ou non
if x3 >= 1001:
trophee_usinex1000.config(state = NORMAL)
else:
trophee_usinex1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 laboratoires" est activé ou non
if x4 >= 1001:
trophee_labox1000.config(state = NORMAL)
else:
trophee_labox1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 multinationales" est activé ou non
if x5 >= 1001:
trophee_multinatiox1000.config(state = NORMAL)
else:
trophee_multinatiox1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 Terre-cookie" est activé ou non
if x6 >= 1001:
trophee_terrecookiex1000.config(state = NORMAL)
else:
trophee_terrecookiex1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 Lune-cookie" est activé ou non
if x7 >= 1001:
trophee_lunecookiex1000.config(state = NORMAL)
else:
trophee_lunecookiex1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 système solaire-cookie" est activé ou non
if x8 >= 1001:
trophee_systemecookiex1000.config(state = NORMAL)
else:
trophee_systemecookiex1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 galaxie-cookie" est activé ou non
if x9 >= 1001:
trophee_galaxiecookiex1000.config(state = NORMAL)
else:
trophee_galaxiecookiex1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 cookivers" est activé ou non
if x10 >= 1001:
trophee_cookiversx1000.config(state = NORMAL)
else:
trophee_cookiversx1000.config(state = DISABLED, bg = 'grey')
#configure si le bouton trophee "acheter 1000 cookinfini" est activé ou non
if x11 >= 1001:
trophee_cookinfinix1000.config(state = NORMAL)
else:
trophee_cookinfinix1000.config(state = DISABLED, bg = 'grey')
#création de la fonction de réouverture de la fenêtre 1
#et de fermeture de la fenêtre 2
def openclose():
fen2.destroy()
fen.deiconify()
quitter2 = tkinter.Button(fen2,text = 'Quitter',height = 2, width = 12, bg = 'red',
command = openclose)
quitter2.grid(row = 0, column = 6)
#création du bouton "trophées"
trophee = tkinter.Button(fen, text = "Trophées", width = 16, height = 1,
background = 'green', command = trophees)
trophee.grid(row = 6, column = 0)
#création de la fonction qui affiche le menu
def menu():
fen.withdraw()
fen3 = tkinter.Tk()
fen3.config(background = 'pink')
#création de l'étiquette "nombre d'améliorations du cookie achetées"
l_cookie_menu = tkinter.Label(fen3, text = "Nombre d'améliorations du cookie achetées :", width = 48, height = 1)
l_cookie_menu.grid(row = 1, column = 0)
#création de l'étiquette "nombre de cuisines achetées"
l_cuisine_menu = tkinter.Label(fen3, text = "Nombre de cuisines achetées :", width = 48, height = 1)
l_cuisine_menu.grid(row = 2, column = 0)
#création de l'étiquette "nombre de magasins achetés"
l_magasin_menu = tkinter.Label(fen3, text = "Nombre de magasins achetés :", width = 48, height = 1)
l_magasin_menu.grid(row = 3, column = 0)
#création de l'étiquette "nombre d'usines achetées"
l_usine_menu = tkinter.Label(fen3, text = "Nombre d'usines achetées :", width = 48, height = 1)
l_usine_menu.grid(row = 4, column = 0)
#création de l'étiquette "nombre de laboratoires achetés"
l_labo_menu = tkinter.Label(fen3, text = "Nombre de laboratoires achetés :", width = 48, height = 1)
l_labo_menu.grid(row = 5, column = 0)
#création de l'étiquette "nombre de multinationales achetées"
l_multinatio_menu = tkinter.Label(fen3, text = "Nombre de multinationales achetées :", width = 48, height = 1)
l_multinatio_menu.grid(row = 6, column = 0)
#création de l'étiquette "nombre de Terre-cookies achetées"
l_terrecookie_menu = tkinter.Label(fen3, text = "Nombre de Terre-cookies achetées :", width = 48, height = 1)
l_terrecookie_menu.grid(row = 7, column = 0)
#création de l'étiquette "nombre de Lune-cookies achetées"
l_lunecookie_menu = tkinter.Label(fen3, text = "Nombre de Lune-cookies achetées :", width = 48, height = 1)
l_lunecookie_menu.grid(row = 8, column = 0)
#création de l'étiquette "nombre de système solaire-cookies achetés"
l_systemecookie_menu = tkinter.Label(fen3, text = "Nombre de système solaire-cookies achetés :", width = 48, height = 1)
l_systemecookie_menu.grid(row = 9, column = 0)
#création de l'étiquette "nombre de galaxie-cookie achetées"
l_galaxiecookie_menu = tkinter.Label(fen3, text = "Nombre de galaxie-cookies achetées :", width = 48, height = 1)
l_galaxiecookie_menu.grid(row = 10, column = 0)
#création de l'étiquette "nombre de cookivers achetés"
l_cookivers_menu = tkinter.Label(fen3, text = "Nombre de cookivers achetés :", width = 48, height = 1)
l_cookivers_menu.grid(row = 11, column = 0)
#création de l'étiquette "nombre de cookinfinis achetés"
l_cookinfini_menu = tkinter.Label(fen3, text = "Nombre de cookinfinis achetés :", width = 48, height = 1)
l_cookinfini_menu.grid(row = 12, column = 0)
#création de l'étiquette montrant le nombre d'amélioration du cookie achetées
a_cookie_menu = tkinter.Label(fen3, text = int(x - 1), width = 48, height = 2)
a_cookie_menu.grid(row = 1, column = 1)
#création de l'étiquette montrant le nombre de cuisines achetées
a_cuisine_menu = tkinter.Label(fen3, text = int(x1 - 1), width = 48, height = 2)
a_cuisine_menu.grid(row = 2, column = 1)
#création de l'étiquette montrant le nombre de magasins achetés
a_magasin_menu = tkinter.Label(fen3, text = int(x2 - 1), width = 48, height = 2)
a_magasin_menu.grid(row = 3, column = 1)
#création de l'étiquette montrant le nombre d'usines achetées
a_usine_menu = tkinter.Label(fen3, text = int(x3 - 1), width = 48, height = 2)
a_usine_menu.grid(row = 4, column = 1)
#création de l'étiquette montrant le nombre de laboratoires achetés
a_labo_menu = tkinter.Label(fen3, text = int(x4 - 1), width = 48, height = 2)
a_labo_menu.grid(row = 5, column = 1)
#création de l'étiquette montrant le nombre de multinationales achetées
a_multinatio_menu = tkinter.Label(fen3, text = int(x5 - 1), width = 48, height = 2)
a_multinatio_menu.grid(row = 6, column = 1)
#création de l'étiquette montrant le nombre de Terre-cookies achetées
a_terrecookie_menu = tkinter.Label(fen3, text = int(x6 - 1), width = 48, height = 2)
a_terrecookie_menu.grid(row = 7, column = 1)
#création de l'étiquette montrant le nombre de Lune-cookies achetées
a_lunecookie_menu = tkinter.Label(fen3, text = int(x7 - 1), width = 48, height = 2)
a_lunecookie_menu.grid(row = 8, column = 1)
#création de l'étiquette montrant le nombre de Système solaire_cookies achetés
a_systemecookie_menu = tkinter.Label(fen3, text = int(x8 - 1), width = 48, height = 2)
a_systemecookie_menu.grid(row = 9, column = 1)
#création de l'étiquette montrant le nombre de galaxie_cookies achetées
a_galaxiecookie_menu = tkinter.Label(fen3, text = int(x9 - 1), width = 48, height = 2)
a_galaxiecookie_menu.grid(row = 10, column = 1)
#création de l'étiquette montrant le nombre de cookivers achetés
a_cookivers_menu = tkinter.Label(fen3, text = int(x10 - 1), width = 48, height = 2)
a_cookivers_menu.grid(row = 11, column = 1)
#création de l'étiquette montrant le nombre de cookinfinis achetés
a_cookinfini_menu = tkinter.Label(fen3, text = int(x11 - 1), width = 48, height = 2)
a_cookinfini_menu.grid(row = 12, column = 1)
#création de l'étiquette options
l_options = tkinter.Label(fen3, text = 'Options', width = 32, height = 2)
l_options.grid(row = 0, column = 4)
#création de l'étiquette de changement de couleur de fond
l_bgcolor = tkinter.Label(fen3, text = 'changement de couleur de le fenêtre principale :', width = 32, height = 1)
l_bgcolor.grid(row = 1, column = 4)
#création de la fonction pour changer la fenêtre en rouge
def rouge():
global bg_color
fen.config(bg = 'red')
d_ameliorations.config(bg = 'red')
d_definitions.config(bg = 'red')
cout.config(bg = 'red')
cout2.config(bg = 'red')
cout3.config(bg = 'red')
cout4.config(bg = 'red')
cout5.config(bg = 'red')
cout6.config(bg = 'red')
cout7.config(bg = 'red')
cout8.config(bg = 'red')
cout9.config(bg = 'red')
cout10.config(bg = 'red')
cout11.config(bg = 'red')
cout12.config(bg = 'red')
quitter.config(bg = 'orange')
menu.config(bg = 'yellow')
trophee.config(bg = 'green')
bg_color = 1
#création de la fonction pour changer la fenêtre en bleu
def bleu():
global bg_color
fen.config(bg = 'blue')
d_ameliorations.config(bg = 'blue')
d_definitions.config(bg = 'blue')
cout.config(bg = 'blue')
cout2.config(bg = 'blue')
cout3.config(bg = 'blue')
cout4.config(bg = 'blue')
cout5.config(bg = 'blue')
cout6.config(bg = 'blue')
cout7.config(bg = 'blue')
cout8.config(bg = 'blue')
cout9.config(bg = 'blue')
cout10.config(bg = 'blue')
cout11.config(bg = 'blue')
cout12.config(bg = 'blue')
quitter.config(bg = 'red')
menu.config(bg = 'yellow')
trophee.config(bg = 'green')
bg_color = 2
#création de la fonction pour changer la fenêtre en vert
def vert():
global bg_color
fen.config(bg = 'green')
d_ameliorations.config(bg = 'green')
d_definitions.config(bg = 'green')
cout.config(bg = 'green')
cout2.config(bg = 'green')
cout3.config(bg = 'green')
cout4.config(bg = 'green')
cout5.config(bg = 'green')
cout6.config(bg = 'green')
cout7.config(bg = 'green')
cout8.config(bg = 'green')
cout9.config(bg = 'green')
cout10.config(bg = 'green')
cout11.config(bg = 'green')
cout12.config(bg = 'green')
menu.config(bg = 'yellow')
quitter.config(bg = 'red')
trophee.config(bg = 'cyan')
bg_color = 3
#création de la fonction pour changer la fenêtre en jaune
def jaune():
global bg_color
fen.config(bg = 'yellow')
d_ameliorations.config(bg = 'yellow')
d_definitions.config(bg = 'yellow')
cout.config(bg = 'yellow')
cout2.config(bg = 'yellow')
cout3.config(bg = 'yellow')
cout4.config(bg = 'yellow')
cout5.config(bg = 'yellow')
cout6.config(bg = 'yellow')
cout7.config(bg = 'yellow')
cout8.config(bg = 'yellow')
cout9.config(bg = 'yellow')
cout10.config(bg = 'yellow')
cout11.config(bg = 'yellow')
cout12.config(bg = 'yellow')
menu.config(bg = 'orange')
quitter.config(bg = 'red')
trophee.config(bg = 'green')
bg_color = 4
#création de la fonction pour changer la fenêtre en rose
def rose():
global bg_color
fen.config(bg = 'pink')
d_ameliorations.config(bg = 'pink')
d_definitions.config(bg = 'pink')
cout.config(bg = 'pink')
cout2.config(bg = 'pink')
cout3.config(bg = 'pink')
cout4.config(bg = 'pink')
cout5.config(bg = 'pink')
cout6.config(bg = 'pink')
cout7.config(bg = 'pink')
cout8.config(bg = 'pink')
cout9.config(bg = 'pink')
cout10.config(bg = 'pink')
cout11.config(bg = 'pink')
cout12.config(bg = 'pink')
menu.config(bg = 'yellow')
quitter.config(bg = 'red')
trophee.config(bg = 'green')
bg_color = 5
#création du bouton pour changer la fenêtre en rouge
b_rouge = tkinter.Button(fen3, bg = 'red', width = 2, height = 1,
command = rouge)
b_rouge.grid(row = 1, column = 5)
#création du bouton pour changer la fenêtre en bleu
b_bleu = tkinter.Button(fen3, bg = 'blue', width = 2, height = 1,
command = bleu)
b_bleu.grid(row = 1, column = 6)
#création du bouton pour changer la fenêtre en vert
b_vert = tkinter.Button(fen3, bg = 'green', width = 2, height = 1,
command = vert)
b_vert.grid(row = 1, column = 7)
#création du bouton pour changer la fenêtre en jaune
b_jaune = tkinter.Button(fen3, bg = 'yellow', width = 2, height = 1,
command = jaune)
b_jaune.grid(row = 1, column = 8)
#création du bouton pour changer la fenêtre en rose
b_rose = tkinter.Button(fen3, bg = 'pink', width = 2, height = 1,
command = rose)
b_rose.grid(row = 1, column = 9)
#création de la fonction de réouverture de la fenêtre 1
#et de fermeture de la fenêtre 3
def openclose():
fen3.destroy()
fen.deiconify()
quitter3 = tkinter.Button(fen3,text = 'Quitter',height = 2, width = 12, bg = 'red',
command = openclose)
quitter3.grid(row = 0, column = 2)
#création du bouton "menu"
menu = tkinter.Button(fen, text = "Menu", width = 16, height = 1,
background = 'yellow', command = menu)
menu.grid(row = 8, column = 0)
#met àjour la couleur du fond d'écran de la fenêtre principale if bg_color == 1: fen.config(bg = 'red') d_ameliorations.config(bg = 'red') d_definitions.config(bg = 'red') cout.config(bg = 'red') cout2.config(bg = 'red') cout3.config(bg = 'red') cout4.config(bg = 'red') cout5.config(bg = 'red') cout6.config(bg = 'red') cout7.config(bg = 'red') cout8.config(bg = 'red') cout9.config(bg = 'red') cout10.config(bg = 'red') cout11.config(bg = 'red') cout12.config(bg = 'red') quitter.config(bg = 'orange') menu.config(bg = 'yellow') trophee.config(bg = 'green') if bg_color == 2: fen.config(bg = 'blue') d_ameliorations.config(bg = 'blue') d_definitions.config(bg = 'blue') cout.config(bg = 'blue') cout2.config(bg = 'blue') cout3.config(bg = 'blue') cout4.config(bg = 'blue') cout5.config(bg = 'blue') cout6.config(bg = 'blue') cout7.config(bg = 'blue') cout8.config(bg = 'blue') cout9.config(bg = 'blue') cout10.config(bg = 'blue') cout11.config(bg = 'blue') cout12.config(bg = 'blue') quitter.config(bg = 'red') menu.config(bg = 'yellow') trophee.config(bg = 'green') if bg_color == 3: fen.config(bg = 'green') d_ameliorations.config(bg = 'green') d_definitions.config(bg = 'green') cout.config(bg = 'green') cout2.config(bg = 'green') cout3.config(bg = 'green') cout4.config(bg = 'green') cout5.config(bg = 'green') cout6.config(bg = 'green') cout7.config(bg = 'green') cout8.config(bg = 'green') cout9.config(bg = 'green') cout10.config(bg = 'green') cout11.config(bg = 'green') cout12.config(bg = 'green') menu.config(bg = 'yellow') quitter.config(bg = 'red') trophee.config(bg = 'cyan') if bg_color == 4: fen.config(bg = 'yellow') d_ameliorations.config(bg = 'yellow') d_definitions.config(bg = 'yellow') cout.config(bg = 'yellow') cout2.config(bg = 'yellow') cout3.config(bg = 'yellow') cout4.config(bg = 'yellow') cout5.config(bg = 'yellow') cout6.config(bg = 'yellow') cout7.config(bg = 'yellow') cout8.config(bg = 'yellow') cout9.config(bg = 'yellow') cout10.config(bg = 'yellow') cout11.config(bg = 'yellow') cout12.config(bg = 'yellow') menu.config(bg = 'orange') quitter.config(bg = 'red') trophee.config(bg = 'green') if bg_color == 5: fen.config(bg = 'pink') d_ameliorations.config(bg = 'pink') d_definitions.config(bg = 'pink') cout.config(bg = 'pink') cout2.config(bg = 'pink') cout3.config(bg = 'pink') cout4.config(bg = 'pink') cout5.config(bg = 'pink') cout6.config(bg = 'pink') cout7.config(bg = 'pink') cout8.config(bg = 'pink') cout9.config(bg = 'pink') cout10.config(bg = 'pink') cout11.config(bg = 'pink') cout12.config(bg = 'pink') menu.config(bg = 'yellow') quitter.config(bg = 'red') trophee.config(bg = 'green') fen.title("C.O.O.K.I.E")
#lance le chronomètre pour l'incrémentation du score sec = 0 time = tkinter.Label(fen, text = sec) timer()
#lance l'horloge du temps de jeu horloge()
#création d'une variable qui réinitialise le jeu def reset(): global amelioration_click global click global score global x global x1 global x2 global x3 global x4 global x5 global x6 global x7 global x8 global x9 global x10 global x11 global secondes global minutes global heures amelioration_click = 1 click = 1 score = 0 x = 1 x1 = 1 x2 = 1 x3 = 1 x4 = 1 x5 = 1 x6 = 1 x7 = 1 x8 = 1 x9 = 1 x10 = 1 x11 = 1 secondes = 0 minutes = 0 heures = 0
#création du bouton "réinitialiser" reset = tkinter.Button(fen, text = "réinitialiser", command = reset) reset.grid(row = 0, column = 6)
fen.mainloop() sl.save(str(score)) sl.save2(str(click)) sl.save3(str(x)) sl.save4(str(x1)) sl.save5(str(x2)) sl.save6(str(x3)) sl.save7(str(x4)) sl.save8(str(x5)) sl.save9(str(x6)) sl.save10(str(x7)) sl.save11(str(x8)) sl.save12(str(x9)) sl.save13(str(x10)) sl.save14(str(x11)) sl.save15(str(secondes)) sl.save16(str(minutes)) sl.save17(str(heures)) sl.save18(str(bg_color))