-
Notifications
You must be signed in to change notification settings - Fork 1
/
GameObj.java
98 lines (77 loc) · 1.7 KB
/
GameObj.java
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import java.awt.Image;
import java.awt.Graphics;
import java.awt.Rectangle;
public class GameObj {
Image img;
int x;
int y;
int width;
int height;
double speed;
Planewar frame;
public Image getImage() {
return img;
}
public void setImage(Image img) {
this.img = img;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public double getSpeed() {
return speed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
public Planewar getFrame() {
return frame;
}
public void setFrame(Planewar frame) {
this.frame = frame;
}
public GameObj() {
}
public GameObj(Image img, int x, int y, double speed) {
this.img = img;
this.x = x;
this.y = y;
this.speed = speed;
}
public GameObj(Image img,int x,int y,int width,int height,double speed,Planewar frame) {
this.img = img;
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.speed = speed;
this.frame = frame;
}
public void paintSelf (Graphics gImage) {
gImage.drawImage(img, x, y,null);
}
public Rectangle getRec() {
return new Rectangle(x,y,width,height);
}
}