-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGM_LT_RCK.pde
More file actions
119 lines (85 loc) · 2.38 KB
/
GM_LT_RCK.pde
File metadata and controls
119 lines (85 loc) · 2.38 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
class gameLayout_rocket{
object_rocket rck;
rocket_itemList rck_il;
public gameLayout_rocket(){
loadPieces();
loadParts();
loadRockets();
rck = new object_rocket();
rck_il = new rocket_itemList();
}
void display(PGraphics GM){
GM.beginDraw();
GM.background(0);
rck.display(GM);
rck_il.display(GM);
objects_rockets.get(1).display(GM);
GM.endDraw();
}
void display(){
}
////
////
////
void loadParts(){
JSONObject json = load_JSON("./data/objects/rocket/parts.json");
JSONArray jsona = json.getJSONArray("parts");
for(int i =0; i < jsona.size(); i++){
JSONObject jsono = jsona.getJSONObject(i);
objects_parts.add(
new rocket_part(
jsono.getString("name"),
jsono.getInt("id"),
jsono.getInt("type"),
jsono.getInt("size")
)
);
}
}
////
////
////
void loadPieces(){
JSONObject json = load_JSON("./data/objects/rocket/pieces.json");
JSONArray jsona = json.getJSONArray("pieces");
for(int i =0; i < jsona.size(); i++){
JSONObject jsono = jsona.getJSONObject(i);
objects_pieces.add(
new rocket_piece(
jsono.getString("name"),
jsono.getInt("id"),
jsono.getInt("type"),
jsono.getInt("size")
)
);
}
}
////
////
////
void loadRockets(){
ArrayList<Integer> parts_id = new ArrayList<Integer>();
JSONObject json = load_JSON("./data/objects/rocket/rockets.json");
JSONArray jsona = json.getJSONArray("rockets");
for(int i =0; i < jsona.size(); i++){
JSONObject jsono = jsona.getJSONObject(i);
int Rid = jsono.getInt("id");
String Rname = jsono.getString("name");
JSONArray jsonoa = jsono.getJSONArray("parts");
for(int j=0; j <jsonoa.size(); j++){
JSONObject jsonoo = jsonoa.getJSONObject(j);
parts_id.add(jsonoo.getInt("id"));
}
println(Rname);
objects_rockets.add(
new object_rocket(
Rname,
Rid,
parts_id
)
);
parts_id.clear();
}
println("rockets: "+objects_rockets);
}
}