-
Notifications
You must be signed in to change notification settings - Fork 117
Expand file tree
/
Copy pathGameObject.java
More file actions
61 lines (45 loc) · 1.14 KB
/
GameObject.java
File metadata and controls
61 lines (45 loc) · 1.14 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package ie.tudublin;
import processing.core.PApplet;
import processing.core.PVector;
public abstract class GameObject {
// Class, subclasses or classes in the same package
protected PVector pos;
public PVector getPos() {
return pos;
}
public void setPos(PVector pos) {
this.pos = pos;
}
public float getRot() {
return rot;
}
public void setRot(float rot) {
this.rot = rot;
}
public PVector getForward() {
return forward;
}
public void setForward(PVector forward) {
this.forward = forward;
}
public int getC() {
return c;
}
public void setC(int c) {
this.c = c;
}
protected float rot;
protected PVector forward;
protected PApplet p;
protected int c;
public GameObject(float x, float y, float rot, int c, PApplet p)
{
pos = new PVector(x, y);
forward = new PVector(0, -1);
this.p = p;
this.rot = rot;
this.c = c;
}
public abstract void update();
public abstract void render();
}