Question: There is no deadline. Code is needed in Java . Create an application based on the specifications given that lets a user run a simple

There is no deadline.

Code is needed in Java.

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. See help document for clarification. You may want to change the specified locations when testing your code.

Specifications

  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 points)
  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 with the description. (3 points)
  4. Output spacing, formatting, and spelling are to match the example console output illustrated above, but of course the game results will be different. (4 points)
  5. Add a meaningful comment for every statement explaining why the statement is in the code. (5 points)
  6. The user will have the option of running the application again. When the user responds to the Play Again? prompt. (5 points)
  7. Create a superclass named GameCharacters with only three instance variables. One is for the characters name, the second is the alive status of the character, and the location of the object in the game. (5 points)
  8. You will use this class in the application to create three GameCharacters objects. These characters are Mario, Barrel, and Gorilla. (5 points)
  9. Create a class for Mario with one instance variable for his health value, a method to move forward one space, and a method to attack or jump on the Gorilla. (5 points)
  10. Create a Gorilla class with no instance variables. (5 points).
  11. Create a Barrel class with no instance variables and a method to move forward one space. (5 points)
  12. Create constructors for all necessary classes and the access (getter and setter) methods for all the instance variables in all classes created. (5 points)
  13. The application must contain and implement these seven methods. You are welcome to add more but these seven 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. (20 points)
  • parameter type: String array
  • return type: void
  • random number generator method- This method will generate a value of 0 or 1. (5 points)
  • no parameters
  • return type: int
  • place characters in game - This method will place the game characters at the starting locations for the game to begin. (5 points)
  • parameter types: Mario, Barrel, Gorilla
  • return type: void
  • display characters - This method will display all the characters by name and location. See example display output. (5 points)
  • parameter types: Mario, Barrel, Gorilla
  • return type: void
  • reset characters This method will reset the characters alive status and locations in order to start a new game. (5 points)
  • parameter types: Mario, Barrel, Gorilla
  • return type: void
  • check attack status This method will determine if an attack by Mario on the Gorilla was successful or not and move the barrel forward. (5 points)
  • parameter types: Mario, Barrel, Gorilla, int
  • return type: void
  • reset moves counter This method will reset the number of moves made. See example display output. (5 points)
  • no parameters
  • return type: int

There is no deadline. Code is needed in Java. 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

1336 PPQ 1 Help 1. Study the example display output closely and carefully. It will tell you a lot. 2. This game is working only along the imaginary x axis. 3. The game starts like this: |__ _ __ __ _1_ I_ 0 1 2 3 4 5 6 Gorilla Mario Barrel 4. Every turn Mario and Barrel move 1 to the left. 5. When Mario is 1 move away from Gorilla, he attacks by jumping on his next turn. If he succeeds by landing on the Gorilla this kills the Gorilla, and Mario wins the game. If he is unsuccessful then he reminds where he is. 6. When Barrel is 1 move away from Mario, he attacks on his next turn. Barrel succeeds by landing on Mario which kills him and the game is over. Mario loses the game. 7. Attacks by Mario are determined by random number. 1 lands him on Gorilla and 0 does not move Mario. 8. Attacks by Barrel are determined when he moves to where Mario is located. 9. Studying the example display output closely and carefully will help to clarify these rules. 10. I recommend you start as soon as possible and work on the classes first and do the main method last. 11. Debugging can be quite challenging. This is another reason to start soon and work on it a little each day. 12. If you have any question concerning the specifications or the help above please post questions in the discussion area but do not post any code snippets. 13. If you need me to look at code and provide feedback send it to me via the Canvas InBox. run: STARTING GAME CHARACTER LOCATIONS Gorilla is at location : 0 Mario is at location : 3 Barrel is at location X: 5 PLAYING MOVE 1 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X: 2 Barrel is at location X:4 PLAYING MOVE 2 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X: 1 Barrel is at location X:3 Random movement number: 0 Mario's attack was unsuccessful. Gorilla not dead. Try again but hurry the barrel is still moving. PLAYING MOVE 3 CHARACTER LOCATIONS Gorilla is at location : 0 Mario is at location X: 1 Barrel is at location X: 2 Random movement number: 1 Gorilla is hit by Mario and dies. Game over. Play Again? Response with 'yes' or 'no' yes PLAYING MOVE 1 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X: 3 Mario is at location Barrel is at location X: 3 X: 5 PLAYING MOVE 2 CHARACTER LOCATIONS Gorilla is at location : 0 Mario is at location X: 2 Barrel is at location : 4 PLAYING MOVE 3 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location : 1 Barrel is at location : 3 Random movement number: 1 Gorilla is hit by Mario and dies. Game over. Play Again? Response with 'yes' or 'no' yes PLAYING MOVE 1 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X:3 Barrel is at location X: 5 Barrers al location X: PLAYING MOVE 2 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X: 2 Barrel is at location : 4 PLAYING MOVE 3 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X: 1 Barrel is at location : 3 Random movement number: 0 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 Mario is at location X: 1 Barrel is at location : 2 Random movement number: 0 Mario's attack was unsuccessful. Gorilla not dead. Try again but hurry the barrel is still moving. Mario is hit by barrel and dies. Game over. Play Again? Response with 'yes' or 'no' no BUILD SUCCESSFUL (total time: 33 seconds) 1336 PPQ 1 Help 1. Study the example display output closely and carefully. It will tell you a lot. 2. This game is working only along the imaginary x axis. 3. The game starts like this: |__ _ __ __ _1_ I_ 0 1 2 3 4 5 6 Gorilla Mario Barrel 4. Every turn Mario and Barrel move 1 to the left. 5. When Mario is 1 move away from Gorilla, he attacks by jumping on his next turn. If he succeeds by landing on the Gorilla this kills the Gorilla, and Mario wins the game. If he is unsuccessful then he reminds where he is. 6. When Barrel is 1 move away from Mario, he attacks on his next turn. Barrel succeeds by landing on Mario which kills him and the game is over. Mario loses the game. 7. Attacks by Mario are determined by random number. 1 lands him on Gorilla and 0 does not move Mario. 8. Attacks by Barrel are determined when he moves to where Mario is located. 9. Studying the example display output closely and carefully will help to clarify these rules. 10. I recommend you start as soon as possible and work on the classes first and do the main method last. 11. Debugging can be quite challenging. This is another reason to start soon and work on it a little each day. 12. If you have any question concerning the specifications or the help above please post questions in the discussion area but do not post any code snippets. 13. If you need me to look at code and provide feedback send it to me via the Canvas InBox. run: STARTING GAME CHARACTER LOCATIONS Gorilla is at location : 0 Mario is at location : 3 Barrel is at location X: 5 PLAYING MOVE 1 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X: 2 Barrel is at location X:4 PLAYING MOVE 2 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X: 1 Barrel is at location X:3 Random movement number: 0 Mario's attack was unsuccessful. Gorilla not dead. Try again but hurry the barrel is still moving. PLAYING MOVE 3 CHARACTER LOCATIONS Gorilla is at location : 0 Mario is at location X: 1 Barrel is at location X: 2 Random movement number: 1 Gorilla is hit by Mario and dies. Game over. Play Again? Response with 'yes' or 'no' yes PLAYING MOVE 1 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X: 3 Mario is at location Barrel is at location X: 3 X: 5 PLAYING MOVE 2 CHARACTER LOCATIONS Gorilla is at location : 0 Mario is at location X: 2 Barrel is at location : 4 PLAYING MOVE 3 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location : 1 Barrel is at location : 3 Random movement number: 1 Gorilla is hit by Mario and dies. Game over. Play Again? Response with 'yes' or 'no' yes PLAYING MOVE 1 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X:3 Barrel is at location X: 5 Barrers al location X: PLAYING MOVE 2 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X: 2 Barrel is at location : 4 PLAYING MOVE 3 CHARACTER LOCATIONS Gorilla is at location X: 0 Mario is at location X: 1 Barrel is at location : 3 Random movement number: 0 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 Mario is at location X: 1 Barrel is at location : 2 Random movement number: 0 Mario's attack was unsuccessful. Gorilla not dead. Try again but hurry the barrel is still moving. Mario is hit by barrel and dies. Game over. Play Again? Response with 'yes' or 'no' no BUILD SUCCESSFUL (total time: 33 seconds)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!