-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTankObjects.java
More file actions
46 lines (42 loc) · 1.03 KB
/
TankObjects.java
File metadata and controls
46 lines (42 loc) · 1.03 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
import java.awt.Rectangle;
import java.awt.Graphics;
import java.awt.Shape;
public abstract class TankObjects {
public final int blockWidth = 32;
public final int blockHeight = 32;
double x, y, theta;
int xxAxis;
int yyAxis;
int lifepoints;
int mushrooms;
private TankObjectID id;
public TankObjects(double x, double y, TankObjectID id) {
this.x = x;
this.y = y;
this.id = id;
}
public abstract void clock();
//public abstract void clock1();
public abstract void create(Graphics graphics);
public abstract void createMini(Graphics graphics, int x, int y);
public abstract Rectangle getRectangle();
public abstract Shape getShape();
public int getHealth() {
return lifepoints;
}
public int getLives() {
return mushrooms;
}
public double xCoordinate() {
return x;
}
public double yCoordinate() {
return y;
}
public void setHealth(int h) {
this.lifepoints = h;
}
public TankObjectID fetchObject() {
return id;
}
}