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:
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)