forked from rick2785/JavaCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnemyShip2.java
More file actions
33 lines (20 loc) · 723 Bytes
/
EnemyShip2.java
File metadata and controls
33 lines (20 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public abstract class EnemyShip2 {
private String name;
private double speed;
private double directionX;
private double directionY;
private double amtDamage;
public String getName() { return name; }
public void setName(String newName) { name = newName; }
public double getDamage() { return amtDamage; }
public void setDamage(double newDamage) { amtDamage = newDamage; }
public void followHeroShip(){
System.out.println(getName() + " is following the hero");
}
public void displayEnemyShip(){
System.out.println(getName() + " is on the screen");
}
public void enemyShipShoots() {
System.out.println(getName() + " attacks and does " + getDamage() + " damage to hero");
}
}