Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def bouger_piece2 (event):
- """
- """
- global cpt
- touche = event.keysym
- pos = position_case_vide(taquin)
- if not(est_resolu(taquin)):
- if touche == "Up" :
- if pos[1] + 1 < 4:
- echanger(taquin,(pos[0],pos[1] + 1),pos)
- else :
- showwarning('Taquin','Mouvement impossible')
- elif touche == "Down" :
- if pos[1] - 1 >= 0:
- echanger(taquin, (pos[0],pos[1] - 1),pos)
- else :
- showwarning('Taquin','Mouvement impossible')
- elif touche == "Right" :
- if pos[0] + 1 < 4:
- echanger(taquin, (pos[0] + 1,pos[1]),pos)
- else :
- showwarning('Taquin','Mouvement impossible')
- elif touche == "Left" :
- if pos[0] - 1 >= 0:
- echanger(taquin, (pos[0] - 1,pos[1]),pos)
- else :
- showwarning('Taquin','Mouvement impossible')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement