-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGM_LT_RCK_rocket.pde
More file actions
59 lines (47 loc) · 1.23 KB
/
GM_LT_RCK_rocket.pde
File metadata and controls
59 lines (47 loc) · 1.23 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
class object_rocket{
int id;
String name = "none";
int positionX = width/2;
int positionY = height/2;
int power;
int capacity;
int weight;
int type;
ArrayList<rocket_part> my_parts = new ArrayList<rocket_part>();
public object_rocket(){
}
public object_rocket(String tname, int tid, ArrayList<Integer> al){
id = tid;
name = tname;
loadRocketParts(al);
}
public object_rocket(int tid, String tname, int ttype){
id = tid;
name = tname;
type = ttype;
}
void display(PGraphics GM){
for(rocket_part rp : my_parts){
rp.display(GM);
}
GM.stroke(255);
GM.text(name, positionX, positionY);
}
void loadRocketParts(ArrayList<Integer> al){
for(int i =0; i < al.size(); i++){
for(int j =0; j < objects_parts.size();j++){
if(al.get(i) == objects_parts.get(j).id){
my_parts.add(
new rocket_part(
objects_parts.get(j).name,
objects_parts.get(j).id,
objects_parts.get(j).type,
objects_parts.get(j).size
)
);
}
}
}
println("parts in rocket: "+my_parts);
}
}