Question: Java NetBeans Write a program that creates a text based video game. The main character is the user and they will fight a main boss
Java NetBeans
Write a program that creates a text based video game. The main character is the user and they will fight a main boss and monsters. The main program will need to loop until the end of the level when the main character enters the boss fight. It should loop 10 times, and each time will generate a random number between 1-5 that controls what happens to the player.
If a 1 or a 2, print to the screen You keep walking
If a 3 or a 4, print to the screen You encountered a monster! and begin a monster battle.
If a 5, print to the screen Hmma treasure chest. I wonder whats inside
If the main character is still alive after the end of the 10th iteration of the loop, they will enter the final boss battle.
The main character, monsters, and final boss should each inherit from a class called Creature. This class should contain a variable called HP (for health points) and MaxAttackPoints, which is the highest amount of damage that can be dealt by that creature.It should also have a function called BasicAttack which reduces the opponents HP by a randomly generated value between 1 and the attacking creatures Max Attack Points.
The Main Characters HP should be set to 80 and MaxAttackPoints to 20.
The Monsters HP should be set to 15 and MaxAttackPoints to 5.
The Final Boss HP should be set to 100 and MaxAttackPoints to 20.
The main character should have a function called Sleep attack that deals 5 damage.
The final boss should have a special attack function as well.
The treasure chest should gain should give 10hp.
The fights should cause you to enter a while loop where the main character faces his/her opponent until one has an HP of 0.
The main character always attacks first
The amount of HP lost should be printed to the screen
At the end of each fight, the result should be printed to the screen (You won, You lost).
Written:
Pseudo code: Write a pseudocode for this project
UML diagram: Include UML diagrams for each class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
