-
Notifications
You must be signed in to change notification settings - Fork 0
/
levels.js
208 lines (187 loc) · 8.8 KB
/
levels.js
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
const style = `overflow: hidden;
border-right: .15em solid gray;
white-space: nowrap;
margin: 0 auto;
letter-spacing: .1em;
animation:
typing 3s steps(40, end),
blink-caret .75s step-end infinite;`
const className = `flex items-center justify-left font-bold text-lg`
const getCurrentLevel = (index) => {
const levels = [
{
id: 1,
astronautPos: createVector(50,10),
planets: [],
earthPos: createVector(1000, 400),
helper: {pos: createVector(300, 500), r: 80 },
instruction: `<p class="flex font-bold text-lg" style="${style}">Move your mouse to pull yourself.</p>`
},
{
id: 2,
astronautPos: createVector(100,100),
planets: [
{pos: createVector(300, 300), type: "poisonous", r: 80 },
{pos: createVector(550, 200), type: "", r: 60},
],
earthPos: createVector(900, 400),
helper: {pos: createVector(300, 450), r: 80 },
instruction: `<p class="${className}" style="${style}">Avoid the poisonous planet. <span class-"inline"><img src="./assets/poison.png" width="30px"/></span></p>`
},
{
id: 3,
astronautPos: createVector(100,150),
planets: [
{pos: createVector(300, 350), type: "poisonous", r: 80},
{pos: createVector(600, 400), type: "", r: 80},
{pos: createVector(450, 170), type: "", r: 80},
{pos: createVector(950, 170), type: "", r: 80},
],
earthPos: createVector(900, 400),
helper: {pos: createVector(250, 250), r: 80 },
instruction: `<p class="${className}" style="${style}">Best of luck!</p>`
},
{
id: 4,
astronautPos: createVector(1000,100),
planets: [
{pos: createVector(400, 400), type: "", r: 120},
{pos: createVector(550, 360), type: "increase", r: 70},
{pos: createVector(650, 250), type: "poisonous", r: 40},
],
earthPos: createVector(1000, 500),
helper: {pos: createVector(450, 50), r: 80 },
instruction: `<p class="${className}" style="${style}">Touch the 'plus' planet to increase your gavitational pull. <span class-"inline"><img src="./assets/plus.png" width="20px"/></span></p>`
},
{
id: 5,
astronautPos: createVector(100,150),
planets: [
{pos: createVector(200, 150), type: "", r: 20},
{pos: createVector(300, 50), type: "", r: 40},
{pos: createVector(800, 300), type: "", r: 50},
{pos: createVector(300, 360), type: "increase", r: 80},
{pos: createVector(450, 520), type: "poisonous", r: 40},
{pos: createVector(450, 280), type: "poisonous", r: 40},
],
earthPos: createVector(1000, 500),
helper: {pos: createVector(450, 50), r: 80 },
instruction: `<p class="${className}" style="${style}">Best of luck</p>`
},
{
id: 6,
astronautPos: createVector(20,230),
planets: [
{pos: createVector(50, 170), type: "poisonous", r: 50},
{pos: createVector(50, 340), type: "poisonous", r: 50},
{pos: createVector(120, 350), type: "poisonous", r: 50},
{pos: createVector(130, 175), type: "poisonous", r: 30},
{pos: createVector(200, 150), type: "poisonous", r: 55},
{pos: createVector(200, 370), type: "poisonous", r: 50},
{pos: createVector(335, 170), type: "poisonous", r: 50},
{pos: createVector(330, 440), type: "poisonous", r: 50},
{pos: createVector(400, 170), type: "poisonous", r: 50},
{pos: createVector(400, 440), type: "poisonous", r: 50},
{pos: createVector(480, 190), type: "poisonous", r: 50},
{pos: createVector(600, 220), type: "", r: 80},
{pos: createVector(700, 105), type: "", r: 100},
{pos: createVector(500, 140), type: "decrease", r: 40},
{pos: createVector(100, 540), type: "increase", r: 65},
],
earthPos: createVector(1000, 530),
helper: {pos: createVector(300, 80), r: 87 },
instruction: `<p class="${className}" style="${style}">Touch the 'minus' planet to decrease your size. <span class-"inline"><img src="./assets/minus.png" width="20px"/></span></p>`
},
{
id: 7,
astronautPos: createVector(100,250),
planets: [
{pos: createVector(200, 150), type: "", r: 60},
{pos: createVector(300, 50), type: "", r: 70},
{pos: createVector(800, 300), type: "", r: 90},
{pos: createVector(300, 500), type: "", r: 40},
{pos: createVector(200, 400), type: "", r: 50},
{pos: createVector(300, 300), type: "poisonous", r: 60},
{pos: createVector(300, 200), type: "", r: 40},
{pos: createVector(900, 400), type: "poisonous", r: 40},
{pos: createVector(500, 450), type: "poisonous", r: 80},
{pos: createVector(600, 250), type: "increase", r: 60},
],
earthPos: createVector(1000, 500),
helper: {pos: createVector(450, 50), r: 80 },
instruction: `<p class="${className}" style="${style}">Remember, the bigger is not always the better.</p>`
},
{
id: 8,
astronautPos: createVector(20,20),
planets: [
{pos: createVector(150, 170), type: "lessBumpy", r: 30},
{pos: createVector(200, 140), type: "lessBumpy", r: 35},
{pos: createVector(240, 80), type: "lessBumpy", r: 35},
{pos: createVector(280, 30), type: "lessBumpy", r: 30},
{pos: createVector(310, 20), type: "lessBumpy", r: 30},
{pos: createVector(350, 10), type: "lessBumpy", r: 30},
{pos: createVector(20, 400), type: "lessBumpy", r: 30},
{pos: createVector(53, 400), type: "lessBumpy", r: 30},
{pos: createVector(86, 400), type: "lessBumpy", r: 30},
{pos: createVector(120, 400), type: "lessBumpy", r: 30},
{pos: createVector(160, 400), type: "lessBumpy", r: 30},
{pos: createVector(195, 360), type: "lessBumpy", r: 35},
{pos: createVector(235, 300), type: "lessBumpy", r: 35},
{pos: createVector(280, 250), type: "lessBumpy", r: 33},
{pos: createVector(320, 240), type: "lessBumpy", r: 30},
{pos: createVector(350, 210), type: "lessBumpy", r: 30},
{pos: createVector(380, 180), type: "lessBumpy", r: 35},
{pos: createVector(415, 180), type: "lessBumpy", r: 30},
{pos: createVector(450, 150), type: "lessBumpy", r: 35},
{pos: createVector(500, 150), type: "lessBumpy", r: 30},
{pos: createVector(550, 150), type: "lessBumpy", r: 30},
{pos: createVector(590, 150), type: "lessBumpy", r: 30},
{pos: createVector(630, 150), type: "lessBumpy", r: 30},
{pos: createVector(670, 150), type: "lessBumpy", r: 30},
{pos: createVector(720, 150), type: "lessBumpy", r: 30},
{pos: createVector(770, 150), type: "lessBumpy", r: 30},
{pos: createVector(820, 150), type: "lessBumpy", r: 30},
{pos: createVector(870, 150), type: "lessBumpy", r: 30},
{pos: createVector(920, 150), type: "lessBumpy", r: 30},
{pos: createVector(960, 169), type: "lessBumpy", r: 30},
{pos: createVector(1000, 190), type: "lessBumpy", r: 35},
{pos: createVector(1040, 230), type: "lessBumpy", r: 30},
{pos: createVector(1040, 270), type: "lessBumpy", r: 30},
{pos: createVector(1040, 320), type: "lessBumpy", r: 35},
{pos: createVector(1040, 370), type: "lessBumpy", r: 30},
{pos: createVector(1040, 400), type: "lessBumpy", r: 30},
{pos: createVector(1040, 440), type: "lessBumpy", r: 30},
{pos: createVector(1040, 480), type: "lessBumpy", r: 30},
{pos: createVector(1000, 480), type: "lessBumpy", r: 30},
{pos: createVector(960, 480), type: "lessBumpy", r: 30},
{pos: createVector(910, 480), type: "lessBumpy", r: 35},
{pos: createVector(870, 480), type: "lessBumpy", r: 30},
{pos: createVector(820, 480), type: "lessBumpy", r: 35},
{pos: createVector(960, 480), type: "lessBumpy", r: 30},
{pos: createVector(910, 480), type: "lessBumpy", r: 35},
{pos: createVector(870, 480), type: "lessBumpy", r: 30},
{pos: createVector(820, 480), type: "lessBumpy", r: 35},
{pos: createVector(780, 480), type: "lessBumpy", r: 35},
{pos: createVector(750, 480), type: "lessBumpy", r: 30},
{pos: createVector(710, 480), type: "lessBumpy", r: 35},
{pos: createVector(670, 480), type: "lessBumpy", r: 30},
{pos: createVector(620, 480), type: "lessBumpy", r: 35},
{pos: createVector(580, 480), type: "lessBumpy", r: 35},
{pos: createVector(530, 480), type: "lessBumpy", r: 35},
{pos: createVector(490, 480), type: "lessBumpy", r: 35},
{pos: createVector(450, 480), type: "lessBumpy", r: 30},
{pos: createVector(410, 480), type: "lessBumpy", r: 35},
{pos: createVector(370, 480), type: "lessBumpy", r: 30},
{pos: createVector(320, 480), type: "lessBumpy", r: 35},
{pos: createVector(700, 220), type: "poisonous", r: 50},
{pos: createVector(1100, 50), type: "increase", r: 50},
],
earthPos: createVector(900, 300),
earthRad: 40,
helper: {pos: createVector(90, 300), r: 80 },
instruction: `<p class="${className}" style="${style}">Can you complete the game?</p>`
},
];
return levels[index];
}