Esempio n. 1
0
 private void win(int player) { // Niki 15
   ballX += ballStepX * 10; // final ball movement - exit table
   ballY += ballStepY * 10;
   this.stickHits = 0;
   SoundEffect.SCORE.play();
   PingPong.setRunning(!PingPong.getRunning()); // Dani
   centeringStickAndBall(); // Dani
   setStepX(0);
   setStepY(0);
   String message =
       "Player "
           + player
           + " WIN!  \nplayer 1  | "
           + firstPlayerResult
           + " - "
           + secondPlayerResult
           + " |  player 2";
   JOptionPane.showMessageDialog(null, message, "Ping Pong Result", JOptionPane.WARNING_MESSAGE);
 }
 @Test
 public void pingPongTestResults_printPingForThree_true() {
   PingPong testPingPong = new PingPong();
   assertEquals("ping", testPingPong.pingPongTestResults(3));
 }