示例#1
0
 private void start() {
   while (true) {
     ball.accelerate();
     ball.interact(paddle);
     ball.move();
     if (ball.isReachToButtom()) {
       System.out.println("Game Over!");
       break;
     }
     repaint();
     try {
       Thread.sleep(INTERVAL);
     } catch (InterruptedException e) {
       e.printStackTrace();
     }
   }
 }
示例#2
0
 private void updatePhysics() {
   b.accelerate(dTime, gravX, gravY);
 }