#Interface Graphique
#_________________________________IMPORTATION___________________________________
from time import *
from tkinter import *
from Projet_fonction import *
#_________________________________DEBUT_FENETRE_________________________________
F1=Tk()
F1.title("PROJET ISN")
F1.geometry ('700x700+200+10')
F1.minsize (700,700)
F1.maxsize (700,700)
#_______________________________IMAGE___________________________________________
Fond_1= PhotoImage (file='Fond_1.gif')
#_______________________________CREATION_DU_FOND_DE_DEPART______________________
fond=Canvas(F1,width=700, height=700)
Accueil_Fond=fond.create_image(350,350,image=Fond_1)
fond.pack()
#________________________________CREATION_DE_LA_FENETRE_DE_JEUX_________________
def Choisir (event):
if 250<=(event.x)<=500 and 200<=(event.y)<=400:
Fenetre2()
if 0<=(event.x)<=100 and 550<=(event.y)<=650:
F1.destroy()
#______________________________FENETRE_2________________________________________
def Fenetre2():
global L1
F1.destroy ()
F2=Tk()
L1= Label(F2, text="Nombre de Cookie:",fg="brown",font=("Impact", 16),relief=RAISED,bg="grey")
L1.pack (side=BOTTOM)
Fond_2= PhotoImage (file='Fond_2.gif')
F2.title("PROJET ISN")
F2.geometry ('700x700+200+10')
F2.minsize (700,700)
F2.maxsize (700,700)
fond2=Canvas(F2,width=700, height=700)
image_fond=fond2.create_image(350,350,image=Fond_2)
fond2.pack()
fond2.bind ('<Button-1>', clique2)
F2.mainloop ()
#______________________________Clique_Sur_Page_Des_Ame__________________________
def clique3 (event):
if 0<=(event.x)<=100 and 0<=(event.y)<=100: #Amélioration 1
Ame1 ()
# if 100<=(event.x)<=600 and 160<=(event.y)<=260: #Amélioration 2
# h ()
# if 100<=(event.x)<=600 and 300<=(event.y)<=400: #Amélioration 3
# h ()
# if 100<=(event.x)<=600 and 440<=(event.y)<=540: #Amélioration 4
# h ()
# if 100<=(event.x)<=600 and 580<=(event.y)<=680: #Amélioration 5
# h ()
#_______________________________FENETRE_3_______________________________________
def Fenetre3():
F3=Tk()
F3.title("PAGE AMELIORATION")
F3.geometry ('700x700+200+10')
F3.minsize (700,700)
F3.maxsize (700,700)
fond3=Canvas(F3,width=700, height=700)
#image_fond=fond2.create_image(500,500,image=Fond_2)
fond3.pack()
fond3.bind ('<Button-1>', clique3)
F3.mainloop ()
#______________________________Clique___________________________________________
def clique2 (event):
if 300<=(event.x)<=400 and 300<=(event.y)<=400:
cliquecookie ()
if 100<=(event.x)<=200 and 100<=(event.y)<=200: #ouverture de la fenêtre ame
Fenetre3 ()
#___________________________________Clique Cookie_______________________________
def cliquecookie():
global Cookie, CookieTotal,L1
CookieTotal=CookieTotal+Cookie
L1.configure (text="Nombre de Cookie: " + str (CookieTotal))
#______________________________AMELIORATION_COOKIE______________________________
def Ame1():
global CookieTotal,PrixAme1,NbrAme1,PrixAme1BASE
if CookieTotal>=PrixAme1 and CookieTotal-PrixAme1>0:
NbrAme1=NbrAme1+1
print(NbrAme1)
print (PrixAme1)
PrixAme1=PrixAme1BASE+(NbrAme1*5)
CookieAme1Total=(NbrAme1*CookieAme1)
CookieTotal=CookieTotal-PrixAme1
#def Ame2():
#global CookieTotal
#_________________________FIN_BOUCLE_FENETR_____________________________________
fond.bind ('<Button-1>',Choisir)
F1.geometry('400x400')
F1.mainloop()
Partager