Question: Write a class definition for an Enemy for your game.java Its java so if i can get the answer in textpad that would be great.

Write a class definition for an Enemy for your game.java
| Its java so if i can get the answer in textpad that would be great. |
3. Write a class definition for an Enemy for your game.java Enemy Class Description Variables int X, Y char Avatar String Race int HP int Attack int Armor Methods Enemy (String NewRace, Newx, NewY) XY location of the enemy. The top left of the screen will be 1.1 The character that will be displayed on the screen Race of the enemy such as "Orc" or "Troll" if you are doing a Middle Earth theme Hitpoints of the enemy. The enemy is dead when HP is Attack rating of the enemy: The higher the number, the more damage is does. Armor rating of the enemy: The higher the armor, the less damage it takes Description Constructor that takes 3 parameters Race, X, Y Initialize your class variables to the parameters: Race= NewRace; X= NewXi Y= NewY; In the constructor, you will set these things based on the Race: Avatar, HP, Attack, Armor. For example if (Race.equals ("Orc")) AvataroHP50: Attack5 Armor 20; Use the following main program to demo your Enemy class: public class game public static void main (String[l args) Enemy E1 new Enemy ("Orc", 8,2) Enemy E2 = new Enemy ("Troll", 5,5); Enemy E3 new Enemy ("Dragon", 9, 9) System . out .printin ("There's a " + E1.Race + " with " + E1.HP + " HP at " + E1.x + ", " + E?.Y); System.out.println("There's a +E2.Race " with "+ E2.HP" HP at " E2.x ", E2.Y) System.out.println ("There's a "E3.Race "with "E3.HP" HP at " E3.x+",E3.Y) // put the Enemy class here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
