Create an application based on the specifications given that lets a user run a simple game to see if Mario kills the Gorilla or the Barrel kills Mario. The game starts with the same three characters in the same designated starting locations.

1.There are many ways to design a solution to this problem but you are evaluated on meeting the specific specifications as given in this quiz.

2.Use proper statement indentation and meaningful variable names in the code.

3.Place a single multi-line comment (not multiple single line comments) giving a description of what this application does before the class header. Include your name and the date along with the description.

4.Output spacing, formatting, and spelling are to match the example console output illustrated above, but of course the game results will be different.

5.Add a meaningful comment for every statement explaining why the statement is in the code.

6.Create a class to instantiate objects that store an x axis value and a y axis value.

7.The user will have the option of running the application again. When the user responds to the "Play Again?" prompt.

8.Create and use an interface with an abstract method called moveForward that does not return any values. The method is to be implemented in the GameCharacters class. Also include two constants in the interface for the values of the alive instance variable in the GameCharacters class.

9.Create a class named GameCharacters with only three instance variables. One is for the character's name, the second is the alive status of the character, and the third is an object of the class that contains x and y axis data.

10.Create constructors and the access (getter and setter) methods for all the instance variables in both classes created in steps 6 and 8.

11.You will use this class in the application to create three GameCharacters objects. These characters are Mario, Barrel, and Gorilla.

12.Use an array (not an ArrayList) to store the GameCharacters objects in the main method.

13.Use a LinkedList in the main method to store three prizes that Mario can win. The prizes are: a bronze metal, a silver medal, and a gold medal.

14.The application must contain and implement these eight methods. You are welcome to add more but these eight are required. Name them whatever you like. The functionality they will perform in the application is summarized below:

  • main method- This method will declare and initialize necessary entities and control execution of the code. Anything not handled is the other methods will be accomplished by the main method or additional methods you added to these required methods.
  • random number generator method- This method will generate a value of 0 or 1.
  • create and populate the prize list method - This method will create and populate the appropriate data structure to store the available prizes .
  • create characters - This method will create the game characters and initialize all their instance variables.
  • display characters - This method will display all the characters by name and location. See example display output.
  • reset characters- This method will reset the characters' alive status and location in order to start a new game.
  • check attack status -This method will determine if an attack by Mario on the Gorilla was successful or not.
  • reset moves counter - This method will reset the number of moves made. See example display output.

Sample output:

run:
STARTING GAME CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 3
Barrel is at location x: 0 y: 5

PLAYING MOVE 1 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 2
Barrel is at location x: 0 y: 4

PLAYING MOVE 2 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 3

Mario's attack was successful. Gorilla is dead.
Mario wins a Bronze metal

PLAYING MOVE 1 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 3
Barrel is at location x: 0 y: 5

PLAYING MOVE 2 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 2
Barrel is at location x: 0 y: 4

PLAYING MOVE 3 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 3

Mario's attack was unsuccessful. Gorilla not dead. Try again but hurry the barrel is still moving.
PLAYING MOVE 4 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 2

Mario's attack was unsuccessful. Gorilla not dead. Try again but hurry the barrel is still moving.
PLAYING MOVE 5 CHARACTER LOCATIONS

Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 1

Mario is hit by barrel and dies. Game over.
Play Again? Response with 'yes' or 'no'
yes
STARTING GAME CHARACTER LOCATIONS
PLAYING MOVE 1 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 3
Barrel is at location x: 0 y: 5

PLAYING MOVE 2 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 2
Barrel is at location x: 0 y: 4

PLAYING MOVE 3 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 3

Mario's attack was successful. Gorilla is dead.
Mario wins a Bronze metal

PLAYING MOVE 1 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 3
Barrel is at location x: 0 y: 5

PLAYING MOVE 2 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 2
Barrel is at location x: 0 y: 4

PLAYING MOVE 3 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 3

Mario's attack was successful. Gorilla is dead.
Mario wins a Silver metal

PLAYING MOVE 1 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 3
Barrel is at location x: 0 y: 5

PLAYING MOVE 2 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 2
Barrel is at location x: 0 y: 4

PLAYING MOVE 3 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 3

Mario's attack was unsuccessful. Gorilla not dead. Try again but hurry the barrel is still moving.
PLAYING MOVE 4 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 2

Mario's attack was unsuccessful. Gorilla not dead. Try again but hurry the barrel is still moving.
PLAYING MOVE 5 CHARACTER LOCATIONS

Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 1

Mario is hit by barrel and dies. Game over.
Play Again? Response with 'yes' or 'no'
yes
STARTING GAME CHARACTER LOCATIONS
PLAYING MOVE 1 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 3
Barrel is at location x: 0 y: 5

PLAYING MOVE 2 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 2
Barrel is at location x: 0 y: 4

PLAYING MOVE 3 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 3

Mario's attack was successful. Gorilla is dead.
Mario wins a Bronze metal

PLAYING MOVE 1 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 3
Barrel is at location x: 0 y: 5

PLAYING MOVE 2 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 2
Barrel is at location x: 0 y: 4

PLAYING MOVE 3 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 3

Mario's attack was unsuccessful. Gorilla not dead. Try again but hurry the barrel is still moving.
PLAYING MOVE 4 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 2

Mario's attack was successful. Gorilla is dead.
Mario wins a Silver metal

PLAYING MOVE 1 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 3
Barrel is at location x: 0 y: 5

PLAYING MOVE 2 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 2
Barrel is at location x: 0 y: 4

PLAYING MOVE 3 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 3

Mario's attack was unsuccessful. Gorilla not dead. Try again but hurry the barrel is still moving.
PLAYING MOVE 4 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 2

Mario's attack was successful. Gorilla is dead.
Mario wins a Gold metal

PLAYING MOVE 1 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 3
Barrel is at location x: 0 y: 5

PLAYING MOVE 2 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 2
Barrel is at location x: 0 y: 4

PLAYING MOVE 3 CHARACTER LOCATIONS
Gorilla is at location x: 0 y: 0
Mario is at location x: 0 y: 1
Barrel is at location x: 0 y: 3

Mario's attack was successful. Gorilla is dead.

Congratulations Mario, you have won all the prizes
Play Again? Response with 'yes' or 'no'
no
BUILD SUCCESSFUL (total time: 1 minutes 4 seconds)
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.