|
|
@ -15,7 +15,6 @@ class Carte: |
|
|
|
|
|
|
|
class Jeux: |
|
|
|
def __init__ (self, nbr_cartes): |
|
|
|
#self.window = Tk() |
|
|
|
self.nb = nbr_cartes |
|
|
|
if self.nb != 32 and self.nb != 52: |
|
|
|
raise ValueError("Choisissez 32 ou 52 cartes") |
|
|
@ -34,6 +33,23 @@ class Jeux: |
|
|
|
for player in players: |
|
|
|
player.enfiler(self.paquet.pop(0)) |
|
|
|
|
|
|
|
def click(event): |
|
|
|
print("ok") |
|
|
|
|
|
|
|
window = Tk() |
|
|
|
window.title("Bataille") |
|
|
|
window.geometry(f"700x400+300+200") |
|
|
|
|
|
|
|
canvas = Canvas(window, width = 650, height = 300, background = "#fff") |
|
|
|
canvas.place(x = 25, y = 50) |
|
|
|
|
|
|
|
player1_pack = canvas.create_rectangle(50, 100, 150, 250, fill = "#f77") |
|
|
|
player1_carte = canvas.create_rectangle(200, 75, 300, 225, fill = "#fff") |
|
|
|
|
|
|
|
player2_pack = canvas.create_rectangle(500, 100, 600, 250, fill = "#f77") |
|
|
|
player2_carte = canvas.create_rectangle(350, 75, 450, 225, fill = "#fff") |
|
|
|
|
|
|
|
canvas.bind("<Button 1>", click) |
|
|
|
couleurs = ["Coeur", "Pique", "Carreaux", "Trèfle"] |
|
|
|
numeros = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] |
|
|
|
|
|
|
|