Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

For this assignment, students will develop a turn-based ghost hunting game with two different levels of ghosts. The key learning objectives for this assignment are:

For this assignment, students will develop a turn-based ghost hunting game with two different levels of ghosts. The key learning objectives for this assignment are: ability to setup and use classes, understanding and using inheritance, use of overloaded constructors.

The overall game concept: You are a ghost hunter character in a game. You are trying to clear the ghosts from a haunted house. As you enter each room, you encounter ghosts that you must battle in order to move on. Once you have battled and destroyed 3 ghosts and the boss ghost, the house is cleared and it is ready for a family to move in.

Since both ghost types share common attributes, you will setup a parent or super class for Ghost with the shared attributes. Then you will create subclasses that differentiate the specific characteristics of the regular or boss ghost.

Both ghost types will have attributes for their name and the "damage" they inflict on a character. The default constructor for the base or super class, will be to initialize the values to null and zero.

Class RegularGhost: A Regular ghost has a unique attribute for "health restored" to the character once the battle is over and it has been defeated. This value will add to the health of the ghost hunter. This ghost class will have overloaded constructors for three types of ghosts 1) default (no parameters) is 20% chance of escape, 15% damage, and 10 health restore 2) Parameter for chance of escape and damage 3) Parameter for chance of escape, user defined damage levels, and health restore. The parameters will be set in the constructors based on asking the user if they want the game setting on easy, medium, or hard.

Class BossGhost: A Boss ghost has a unique attributes for "health" and "damage taken". There is one overloaded constructor for this class: health and damage inflicted are parameters based on the user difficulty setting. The amount of damage taken will be determined by the battle method chosen by the user. This will impact the health, so at a minimum, you will need setters and getters for the health attribute.

Class GhostHunt: Main program

Pseudocode for Gameplay:

1) Introduce the game to the user

2) Ask the user for a setting level (easy, medium, hard)

3) Ask the user for their character name

4) Introduce the setting

5) Ask the user the room they want to enter, each room has a different ghost (objects with unique names created from default and overloaded constructors)

6) Describe the room

7) The character encounters a regular ghost: Describe the ghost, tell user the battle has started

- Random result based on chance of escape for ghost sucked up or escapes, or damage inflicted to character

- Check for ghost dead or character dead

- Ask user if they want to continue battle or run away

- Repeat above steps until either the user runs away, or the ghost or character loses

- If the user chooses to run away then continue

- If the user wins, then add the "health restored" and continue

- If character/user loses: end game

8) Repeat 5 and 6 until 3 ghosts have been defeated or the character/user loses

9) The character enters the final room and encounters a boss ghost

- Ask the user which tool they want to use (such as: magic spell, ectoplasm vacuum)

- Random result whether it works or not and whether ghost inflicts damage on them or not

- Check for boss ghost or character out of health

- Then repeat the first step of the boss battle until one of them is out of health

- If character/user loses: end game

- If character wins then Congratulate the user on winning! and end your story (the family moves in, everybody is happy, etc.)

For any of your assignments, if the details are not provided, it is up to the designer to choose how they want to implement the requirements. Typically in the workplace, people are not provided with a problem so specific that every aspect is scripted for them. Similarly, I like to provide students the opportunity to make some of their own decisions as the code designer, within the bounds of the guidance and intent of the program. For example, students can come up with any room descriptions that they want. The minimum number of rooms is 4, since the user needs to complete 3 ghosts before moving on to the boss. However, you could have additional descriptions for room choices and additional ghost object instances for more rooms, but only one for each ghost is required. The health starting point and different parameters for the constructor based on level are also up to the designer. If you choose the character health too high, the player will always win, if you choose it too low, they will always lose. Once you play your own game, you can adjust these for a decent player experience. Make sure to turn in all the java class files and execution screenshots that show the user interface functions

In JAVA please

Beginners Gaming knowledge

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions