Question
hey I need this in java I have all the enemy classes you have to create a main class and also can you provide and
hey I need this in java I have all the enemy classes you have to create a main class and also can you provide and output screenshot
i will also give all the enemy classes for and you also have to make last enemy class
The Main class must contain the following objects greenOgre, redOgre, slowZombie, fastZombie, spotDog, and yourNewNameYourObject.
The Enemy class is the parent class and it will have many children classes like Ogre, Zombie, etc which you use to create the objects.
You should be adding additional details to the enemies. Like what additional properties should the NewSkullHead class have that an Ogre class might not.
Enemy Class:-
public class Enemy { protected String name; protected int hp; protected int damage; public Enemy (String name, int hp, int damage){ this.name = name; this.hp = hp; this.damage = damage; } public boolean is_alive (){ return (this.hp > 0); } }
Enemy: Ogre Class:-
public class Ogre extends Enemy{ public Ogre(){ super ( name: "Ogre", hp: 30, damage: 20): } }
Enemy: Zombie Class : -
public class Zombie extends Enemy{ public Zombie(){ super ( name: "Zombie", hp: 20, damage: 15); } }
Enemy: Dog Class : -
public class Dog extends Enemy{ public Dog(){ super(nmae:"Dog",hp:20,damage:15); } }
Enemy: GiantSpider Class : -
public class GiantSpider extends Enemy{ public GiantSpider(){ super(name:"Giant Spider",hp:10,damage:2); } }
Enemy: (Your) Class. :- you have to create this
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started