Bonjour

je suis débutant sur python et je voudrais créer une version de flappy bird pour mon projet de bac,je voudrais creer un bouton nouvelle partie mais le hic c'est que ma fonction command ne marche pas et je ne sais pas pourquoi,car selon moi j'ai remis toutes les déf qui permettent au jeu de fonctionner et je ne vois pas le probleme de mon codage
Le message d'erreur est 'positional argument follows keyword argument'

Merci de votre aide !!

Voici mon code :


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
from tkinter.messagebox import *
from tkinter import *

fenetre= Tk()

def monter(event):
    
    global PosX,PosY
    touche = event.keysym
    

    # déplacement vers le haut
    
    if touche == 'Up'and PosY>15:
        PosY -= 30
        touche = 0

    else:
        PosY == 10 
        PosY -= 0
 
def tomber():

    global PosX,PosY,fin_ou_pas

    fin_ou_pas = fin(PosY)

    # fait tomber le rond toute les 500ms

    if fin_ou_pas != 'fin':
        PosY += 20
        fenetre.after(500,tomber)
        
        Canvas.coords(Rond,PosX -10, PosY -10, PosX +10, PosY +10)
    

def fin(PosY):
    print(PosY)
    if PosY==300:
       showinfo('fin', 'Vous avez perdu fin')
       #messagebox.showinfo("Finish for you LOOSER","PERDU")
       return 'fin'

def fin1(PosX,posA):
    
    if PosX == posA :
        #showinfo('fin', 'Vous avez perdu')

        #messagebox.showinfo("Finish for you LOOSER","PERDU")
        return 'fin1'
   
        
        
        
def avancer():

    global posA,posB
    global posC,posD
    global terminer, PosY, créer

   # terminer = fin1(PosX,posA)
    print(PosX+10,posA-20, PosX-10,posA+20)
    print(PosY-10,posD+100,PosY+10,posB-20)

    if PosY-10>=posD+100 and PosY+10<=posB-20 or PosX+10<=posA-20 or PosX-10>=posA+20:
        # fait avancer le décor
        posA -= 10 #distance
        posC -= 10
        #création nouvel obstacle qui bouge
        Canvas.coords(obstacle,posA -20,posB -0,posA +20,posB +120)
        Canvas.coords(obstacle1,posC -20,posD -20,posC +20,posD +100)

        fenetre.after(800,avancer) #temps

    else:
        showinfo('fin', 'Vous avez perdu avancer')




def repeter():
    
    global avancer
    global posA,posB
    global posC,posD
    global terminer

    #for k in range(1,10,1):
        #créer()
        
        


    
terminer="nul"    
fin_ou_pas="pas"



def perdu():

    if 'fin1':
       showinfo('fin', 'Vous avez perdu')

    else:
        if 'fin':
            showinfo('fin', 'Vous avez perdu')

            
Bouton2 = Button(fenetre,text="Nouvelle partie",command=monter,tomber,fin,fin1,avancer,repeter,perdu)     
Bouton2.pack(side=LEFT, padx = 25, pady = 15)
Bouton2.config(font=('arial', 13, 'bold'))
Bouton2.activeforeground="red"
Bouton2.activebackground="blue"