function update_scores(player1, player2) { // Update the scores. _player1.score += player1; _player2.score += player2; // Reset the ball. init_ball(); // Which direction should the next ball be served? // It should come from the player who just scored the point. if (player2 > 0) { _ball.velocity_x *= -1; }}