Use this code:
【General guidance】The answer provided below has been developed in a clear step by step manner.Step1/3logical framework and algorithm used to construct the game in Java.1.Make a class called "Game" with the following characteristics: Players two objects An integer that counts the number of games that have been tied An integer to record the total amount of movie tickets that the losing player is required to pay.2.Create a play() function for the Game class that mimics a basketball shootout: Up until each player has made three shots, each player takes turns shooting the ball. Please update the player's score after each shot (i.e., the number of successful baskets made) With the scores, decide who will win the game. Increase the tie counter if the game is still tied. Based on the difference between the winner's score and the loser's score, as well as the number of tied games, determine how many movie tickets the losing player owes.3.Make a class called "Player" with the following characteristics: A name A number that serves as the player's score counter a boolean to show whether the player has the opportunity to shoot4.In the Player class, create a shoot() method that simulates a player shooting the ball: Generate a random number between 0 and 1 to determine if the shot is successful If the shot is successful, increment the player's score In the main() method, create a Game object and call the play() method to start the game. Repeat the game until a winner is determined.Explanation:Please refer to solution in this step.Step2/3Here's a sample implementation of the Game and Player classesimport java.util.Random;public class Game { private Player player1; private Player player2; private int numTies; private int numTickets; public Game(Player player1, Player player2) { this.player1 = player1; this.player2 = player2; this.numTies = 0; this.numTickets = 0; } public void play() { player1.setTurn(true); player2.setTurn(false); while (player1.getNumShots() < 3 || player2.getNumShots() < 3) { if (player1.getTurn()) { player1.shoot(); if (player1.getNumShots() == 3) { player1.setTurn(false); player2.setTurn(true); } } else { player2.shoot(); if (player2.getNumShots() == 3) { player1.setTurn(true); player2.setTurn(false); } } } int player1Score = player1.getScore(); int player2Score = player2.getScore(); if (player1Score > player2Score) { numTickets += player1Score - player2Score; } else if (player1Score < player2Score) { numTickets += player2Score - player1Score; } else { numTies++; } } public int getNumTies() { return numTies; } public int getNumTickets() { return numTickets; }}public class Player { private String name; private int score; private int numShots; private boolean turn; public Player(String name) { this.name = name; this.score = 0; this.numShots = 0; this.turn = false; } public void shoot() { ... See the full answer