Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. def bouger_piece2 (event):
  2. """
  3. """
  4. global cpt
  5.  
  6. touche = event.keysym
  7. pos = position_case_vide(taquin)
  8.  
  9. if not(est_resolu(taquin)):
  10. if touche == "Up" :
  11. if pos[1] + 1 < 4:
  12. echanger(taquin,(pos[0],pos[1] + 1),pos)
  13. else :
  14. showwarning('Taquin','Mouvement impossible')
  15. elif touche == "Down" :
  16. if pos[1] - 1 >= 0:
  17. echanger(taquin, (pos[0],pos[1] - 1),pos)
  18. else :
  19. showwarning('Taquin','Mouvement impossible')
  20. elif touche == "Right" :
  21. if pos[0] + 1 < 4:
  22. echanger(taquin, (pos[0] + 1,pos[1]),pos)
  23. else :
  24. showwarning('Taquin','Mouvement impossible')
  25. elif touche == "Left" :
  26. if pos[0] - 1 >= 0:
  27. echanger(taquin, (pos[0] - 1,pos[1]),pos)
  28. else :
  29. showwarning('Taquin','Mouvement impossible')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement