bollet.c
11 months ago
3 changed files with 5 additions and 62 deletions
@ -1,58 +0,0 @@ |
|||
import tkinter as tk |
|||
from tkinter import messagebox |
|||
from random import choice, randint |
|||
from PIL import Image |
|||
|
|||
pique = "🂡🂢🂣🂤🂥🂦🂧🂨🂩🂪🂫🂬🂭🂮" |
|||
coeur = '🂱🂲🂳🂴🂵🂶🂷🂸🂹🂺🂻🂼🂽🂾' |
|||
carreau = "🃁🃂🃃🃄🃅🃆🃇🃈🃉🃊🃋🃌🃍🃎" |
|||
trefle = "🃑🃒🃓🃔🃕🃖🃗🃘🃙🃚🃛🃜🃝🃞" |
|||
cartes = pique + coeur + carreau + trefle |
|||
|
|||
class Interface(tk.Frame): |
|||
def __init__(self, master): |
|||
"""initialisation de l'interface : présentation du menu""" |
|||
tk.Frame.__init__(self, master) |
|||
self.grid(row=0) |
|||
#revoir le design |
|||
self.menu = tk.Frame() |
|||
|
|||
C = tk.Canvas(self.menu, bg="black",height=450, width=500) |
|||
coord = 10, 50, 240, 210 |
|||
C.grid(row=0) |
|||
|
|||
#image ne fonctionne pas |
|||
#canvas= tk.Canvas(self.menu, width= 300, height=300) |
|||
#image = tk.PhotoImage(file='title_img.png') |
|||
#canvas.create_image(50, 10, image=image) |
|||
#canvas.grid(row=2) |
|||
for i in range(50): |
|||
C.create_text(randint(0,500),randint(0,450),fill="white",font="Times 20",text=choice(cartes)) |
|||
|
|||
titre = tk.Label(self.menu, text="Bataille",bg="grey", fg="white",font=("eufm10", 42)) |
|||
titre.grid(row=0) |
|||
|
|||
|
|||
|
|||
jouer_btn = tk.Button(self.menu, text ="Jouer", command=self.jouer) |
|||
jouer_btn.grid(row=1,pady=(0, 0)) |
|||
self.menu.grid(row=0) |
|||
|
|||
def jouer(self): |
|||
"""interface du jeu""" |
|||
self.clearFrame(self.menu) |
|||
messagebox.showinfo("JEU", "Jeu.") |
|||
|
|||
|
|||
def clearFrame(self, frame): |
|||
# destroy all widgets from frame |
|||
for widget in frame.winfo_children(): |
|||
widget.destroy() |
|||
|
|||
|
|||
if __name__ == "__main__": |
|||
root = tk.Tk() |
|||
root.title("Bataille") |
|||
root.geometry("500x500") |
|||
hello_frame = Interface(root) |
|||
hello_frame.mainloop() |
Loading…
Reference in new issue