Question: JAVA You are to develop an entire program that simulates the way a game is handled in the random creation of its characters. Your program
JAVA
You are to develop an entire program that simulates the way a game is handled in the random creation of its characters. Your program should have the ability to create one of 3 types of character. The choices should be an ogre, archer and a swordsman. Each of these characters will share many of the same types of attributes such as name, life and energy and these should be contained in the Super class that we will call Entity (because Character is already a class). Only the archer and the swordsman are playable, which leaves the ogre to be a Non-Player Character (NPC). This means that the Ogre will be a subclass of the Entity, while the archer and swordsman will be subclasses of Playable which is a subclass of Entity. Below is the diagram. No changes need to be made to the driver.
The Playable class should extend the Entity class and should contain some additional methods that dictate the movement of the character by the user. Note that we will NOT be tracking the movement of the characters to help simplify the lab. The playable class should have a method for moving the character in the 4 standard directions (no diagonals allowed). So up, down, left and right.
Class Name: Entity
Class Level (global) Variables:
strName - String
intLife - Integer
intEnergy - Integer
Method Name: getStrName
Parameters: None
Desired Result: Accessor
Data Returned: strName
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
