Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. public void run() {
  2.  
  3. for(;;) {
  4.  
  5.  
  6. if(leftScore == 3 || rightScore == 3) {
  7.  
  8. gameStarted = false;
  9.  
  10. }
  11. if(gameStarted) {
  12. p1.move();
  13. p2.move();
  14. b1.move();
  15. b1.checkPaddleCollision(p1, p2);
  16. }
  17.  
  18.  
  19.  
  20. repaint();
  21. try {
  22. Thread.sleep(10);
  23. } catch (InterruptedException e) {
  24. e.printStackTrace();
  25. }
  26.  
  27.  
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement