Advertisement
RoshHoul

Untitled

Mar 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. bool move;
  2. int direction;
  3.  
  4. startMovement()
  5.     move = true;
  6.  
  7. stopMovement()
  8.     move = false;
  9.  
  10. changeDirection()
  11.    
  12.  
  13. button.bind('<ButtonPress-1>',start_motor)
  14. button.bind('<ButtonRelease-1>',stop_motor)
  15. root.mainloop()
  16.  
  17. while(true) {
  18.     if (move && KEYUP) {
  19.         positionY++;   
  20.     } else if (move && eventtype.KEYDOWN    ) {
  21.         positionY--;
  22.     } else if ( !move) {
  23.         positionY = positionY;
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement