| 196 | } |
| 197 | |
| 198 | private createWalls(): void{ |
| 199 | // Yes, I know that the code below is quite ugly |
| 200 | // But I had two choices : either write the bounding boxes manually (this is what I chose) |
| 201 | // Or write a specific level editor to do the work for me (it could work with something like the height maps in 3d games - there would be a second "ascii art" composed of 0 and 1 for example, 0 would mean no collision and 1 would mean collision) |
| 202 | // But this is the only level which requires such complicated bounding boxes, so really, writing a level editor for one level isn't worth it |
| 203 | this.addWalls(0, 0, 40, 22, |
| 204 | 0, 23, 39, 23, |
| 205 | 0, 24, 38, 24, |
| 206 | 0, 25, 37, 25, |
| 207 | 0, 26, 36, 26, |
| 208 | 0, 27, 33, 27, |
| 209 | 0, 28, 32, 28, |
| 210 | 0, 29, 31, 29, |
| 211 | 0, 30, 30, 30, |
| 212 | 0, 31, 29, 31, |
| 213 | 0, 32, 28, 32, |
| 214 | 0, 33, 27, 33, |
| 215 | 0, 34, 26, 34, |
| 216 | 0, 35, 25, 35, |
| 217 | 0, 36, 24, 36, |
| 218 | 0, 37, 23, 37, |
| 219 | 0, 38, 22, 59, |
| 220 | 0, 60, 44, 60, |
| 221 | 0, 61, 43, 61, |
| 222 | 0, 62, 27, 62, |
| 223 | 34, 62, 38, 62, |
| 224 | 0, 63, 26, 63, |
| 225 | 0, 64, 25, 66, |
| 226 | 0, 67, 26, 67, |
| 227 | 0, 68, 33, 68, |
| 228 | 0, 69, 32, 69, |
| 229 | 0, 70, 31, 70, |
| 230 | 0, 71, 27, 71, |
| 231 | 0, 72, 26, 72, |
| 232 | 0, 73, 25, 73, |
| 233 | 0, 74, 24, 74, |
| 234 | 0, 75, 16, 75, |
| 235 | 0, 76, 15, 76, |
| 236 | 0, 77, 4, 77, |
| 237 | 0, 78, 3, 80, |
| 238 | 0, 81, 2, 81, |
| 239 | 0, 82, 1, 95, |
| 240 | 36, 73, 39, 73, |
| 241 | 35, 74, 40, 74, |
| 242 | 34, 75, 41, 75, |
| 243 | 33, 76, 49, 76, |
| 244 | 32, 77, 49, 77, |
| 245 | 32, 78, 49, 78, |
| 246 | 33, 79, 49, 79, |
| 247 | 34, 80, 49, 80, |
| 248 | 35, 81, 49, 81, |
| 249 | 36, 82, 49, 82, |
| 250 | 37, 83, 49, 85, |
| 251 | 37, 86, 49, 86, |
| 252 | 38, 87, 50, 87, |
| 253 | 39, 88, 51, 88, |
| 254 | 45, 89, 52, 89, |
| 255 | 46, 90, 54, 90, |