create-exo-app 0.1.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +30 -29
  2. package/bin/create-exo-app.js +3 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +2 -118
  5. package/dist/scaffold.d.ts +44 -0
  6. package/dist/scaffold.js +190 -0
  7. package/package.json +25 -8
  8. package/templates/audio-reactive/index.html +13 -3
  9. package/templates/audio-reactive/package.json +7 -3
  10. package/templates/audio-reactive/src/main.ts +4 -3
  11. package/templates/audio-reactive/src/scenes/AudioReactiveScene.ts +3 -3
  12. package/templates/game-starter/index.html +13 -3
  13. package/templates/game-starter/package.json +6 -3
  14. package/templates/game-starter/src/main.ts +5 -3
  15. package/templates/game-starter/src/objects/Player.ts +1 -1
  16. package/templates/game-starter/src/scenes/GameOverScene.ts +11 -17
  17. package/templates/game-starter/src/scenes/GameScene.ts +59 -26
  18. package/templates/minimal/index.html +13 -3
  19. package/templates/minimal/package.json +6 -3
  20. package/templates/minimal/src/main.ts +5 -4
  21. package/templates/minimal/src/scenes/MainScene.ts +3 -8
  22. package/templates/platformer/README.md +13 -0
  23. package/templates/platformer/index.html +25 -0
  24. package/templates/platformer/package.json +21 -0
  25. package/templates/platformer/public/assets/ART-LICENSE.txt +28 -0
  26. package/templates/platformer/public/assets/platformer-characters.json +1093 -0
  27. package/templates/platformer/public/assets/platformer-characters.png +0 -0
  28. package/templates/platformer/public/assets/platformer-tiles.json +7549 -0
  29. package/templates/platformer/public/assets/platformer-tiles.png +0 -0
  30. package/templates/platformer/src/main.ts +19 -0
  31. package/templates/platformer/src/objects/Player.ts +139 -0
  32. package/templates/platformer/src/scenes/PlatformerScene.ts +237 -0
  33. package/templates/platformer/tsconfig.json +12 -0
  34. package/templates/platformer/vite.config.ts +5 -0
  35. package/templates/top-down/README.md +27 -0
  36. package/templates/top-down/index.html +25 -0
  37. package/templates/top-down/package.json +24 -0
  38. package/templates/top-down/public/assets/ART-LICENSE.txt +21 -0
  39. package/templates/top-down/public/assets/characters.json +1093 -0
  40. package/templates/top-down/public/assets/characters.png +0 -0
  41. package/templates/top-down/public/assets/map-pack.png +0 -0
  42. package/templates/top-down/public/assets/town-square.tmj +689 -0
  43. package/templates/top-down/src/level.ts +59 -0
  44. package/templates/top-down/src/main.ts +29 -0
  45. package/templates/top-down/src/scenes/ProceduralMapScene.ts +74 -0
  46. package/templates/top-down/src/scenes/TiledMapScene.ts +33 -0
  47. package/templates/top-down/src/scenes/TopDownScene.ts +208 -0
  48. package/templates/top-down/tsconfig.json +12 -0
  49. package/templates/top-down/vite.config.ts +5 -0
  50. package/templates/ui-app/README.md +17 -0
  51. package/templates/ui-app/index.html +25 -0
  52. package/templates/ui-app/package.json +20 -0
  53. package/templates/ui-app/public/assets/.gitkeep +0 -0
  54. package/templates/ui-app/src/main.ts +18 -0
  55. package/templates/ui-app/src/scenes/SettingsScene.ts +136 -0
  56. package/templates/ui-app/tsconfig.json +12 -0
  57. package/templates/ui-app/vite.config.ts +5 -0
@@ -0,0 +1,689 @@
1
+ {
2
+ "compressionlevel": -1,
3
+ "height": 15,
4
+ "infinite": false,
5
+ "layers": [
6
+ {
7
+ "data": [
8
+ 1,
9
+ 1,
10
+ 1,
11
+ 1,
12
+ 1,
13
+ 1,
14
+ 1,
15
+ 1,
16
+ 1,
17
+ 1,
18
+ 1,
19
+ 1,
20
+ 1,
21
+ 1,
22
+ 1,
23
+ 1,
24
+ 1,
25
+ 1,
26
+ 1,
27
+ 1,
28
+ 1,
29
+ 1,
30
+ 1,
31
+ 1,
32
+ 1,
33
+ 1,
34
+ 1,
35
+ 1,
36
+ 1,
37
+ 1,
38
+ 1,
39
+ 1,
40
+ 1,
41
+ 1,
42
+ 1,
43
+ 1,
44
+ 1,
45
+ 1,
46
+ 1,
47
+ 1,
48
+ 1,
49
+ 1,
50
+ 1,
51
+ 1,
52
+ 1,
53
+ 1,
54
+ 1,
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183
+ 1,
184
+ 1,
185
+ 1,
186
+ 1,
187
+ 1,
188
+ 1,
189
+ 1,
190
+ 1,
191
+ 1,
192
+ 1,
193
+ 1,
194
+ 1,
195
+ 1,
196
+ 1,
197
+ 1,
198
+ 1,
199
+ 1,
200
+ 1,
201
+ 1,
202
+ 1,
203
+ 1,
204
+ 1,
205
+ 1,
206
+ 1,
207
+ 1,
208
+ 1,
209
+ 1,
210
+ 1,
211
+ 1,
212
+ 1,
213
+ 1,
214
+ 1,
215
+ 1,
216
+ 1,
217
+ 1,
218
+ 1,
219
+ 1,
220
+ 1,
221
+ 1,
222
+ 1,
223
+ 1,
224
+ 1,
225
+ 1,
226
+ 1,
227
+ 1,
228
+ 1,
229
+ 1,
230
+ 1,
231
+ 1,
232
+ 1,
233
+ 1,
234
+ 1,
235
+ 1,
236
+ 1,
237
+ 1,
238
+ 1,
239
+ 1,
240
+ 1,
241
+ 1,
242
+ 1,
243
+ 1,
244
+ 1,
245
+ 1,
246
+ 1,
247
+ 1,
248
+ 1,
249
+ 1,
250
+ 1,
251
+ 1,
252
+ 1,
253
+ 1,
254
+ 1,
255
+ 1,
256
+ 1,
257
+ 1,
258
+ 1,
259
+ 1,
260
+ 1,
261
+ 1,
262
+ 1,
263
+ 1,
264
+ 1,
265
+ 1,
266
+ 1,
267
+ 1,
268
+ 1,
269
+ 1,
270
+ 1,
271
+ 1,
272
+ 1,
273
+ 1,
274
+ 1,
275
+ 1,
276
+ 1,
277
+ 1,
278
+ 1,
279
+ 1,
280
+ 1,
281
+ 1,
282
+ 1,
283
+ 1,
284
+ 1,
285
+ 1,
286
+ 1,
287
+ 1,
288
+ 1,
289
+ 1,
290
+ 1,
291
+ 1,
292
+ 1,
293
+ 1,
294
+ 1,
295
+ 1,
296
+ 1,
297
+ 1,
298
+ 1,
299
+ 1,
300
+ 1,
301
+ 1,
302
+ 1,
303
+ 1,
304
+ 1,
305
+ 1,
306
+ 1,
307
+ 1
308
+ ],
309
+ "height": 15,
310
+ "id": 1,
311
+ "name": "Ground",
312
+ "opacity": 1,
313
+ "type": "tilelayer",
314
+ "visible": true,
315
+ "width": 20,
316
+ "x": 0,
317
+ "y": 0
318
+ },
319
+ {
320
+ "data": [
321
+ 6,
322
+ 6,
323
+ 6,
324
+ 6,
325
+ 6,
326
+ 6,
327
+ 6,
328
+ 6,
329
+ 6,
330
+ 6,
331
+ 6,
332
+ 6,
333
+ 6,
334
+ 6,
335
+ 6,
336
+ 6,
337
+ 6,
338
+ 6,
339
+ 6,
340
+ 6,
341
+ 6,
342
+ 0,
343
+ 0,
344
+ 0,
345
+ 0,
346
+ 0,
347
+ 0,
348
+ 0,
349
+ 0,
350
+ 6,
351
+ 0,
352
+ 0,
353
+ 0,
354
+ 0,
355
+ 0,
356
+ 0,
357
+ 0,
358
+ 0,
359
+ 0,
360
+ 6,
361
+ 6,
362
+ 0,
363
+ 0,
364
+ 0,
365
+ 0,
366
+ 0,
367
+ 0,
368
+ 0,
369
+ 0,
370
+ 6,
371
+ 0,
372
+ 0,
373
+ 0,
374
+ 0,
375
+ 6,
376
+ 6,
377
+ 6,
378
+ 0,
379
+ 0,
380
+ 6,
381
+ 6,
382
+ 0,
383
+ 0,
384
+ 0,
385
+ 0,
386
+ 0,
387
+ 0,
388
+ 0,
389
+ 0,
390
+ 6,
391
+ 0,
392
+ 0,
393
+ 0,
394
+ 0,
395
+ 6,
396
+ 0,
397
+ 0,
398
+ 0,
399
+ 0,
400
+ 6,
401
+ 6,
402
+ 0,
403
+ 0,
404
+ 6,
405
+ 6,
406
+ 6,
407
+ 6,
408
+ 0,
409
+ 0,
410
+ 6,
411
+ 0,
412
+ 0,
413
+ 0,
414
+ 0,
415
+ 6,
416
+ 0,
417
+ 0,
418
+ 0,
419
+ 0,
420
+ 6,
421
+ 6,
422
+ 0,
423
+ 0,
424
+ 0,
425
+ 0,
426
+ 0,
427
+ 6,
428
+ 0,
429
+ 0,
430
+ 6,
431
+ 0,
432
+ 0,
433
+ 0,
434
+ 0,
435
+ 6,
436
+ 6,
437
+ 6,
438
+ 6,
439
+ 0,
440
+ 6,
441
+ 6,
442
+ 0,
443
+ 0,
444
+ 0,
445
+ 0,
446
+ 0,
447
+ 6,
448
+ 0,
449
+ 0,
450
+ 0,
451
+ 0,
452
+ 0,
453
+ 0,
454
+ 0,
455
+ 6,
456
+ 0,
457
+ 0,
458
+ 0,
459
+ 0,
460
+ 6,
461
+ 6,
462
+ 0,
463
+ 0,
464
+ 0,
465
+ 0,
466
+ 0,
467
+ 6,
468
+ 6,
469
+ 6,
470
+ 6,
471
+ 6,
472
+ 6,
473
+ 0,
474
+ 0,
475
+ 6,
476
+ 0,
477
+ 0,
478
+ 0,
479
+ 0,
480
+ 6,
481
+ 6,
482
+ 0,
483
+ 0,
484
+ 0,
485
+ 0,
486
+ 0,
487
+ 0,
488
+ 0,
489
+ 0,
490
+ 0,
491
+ 0,
492
+ 0,
493
+ 0,
494
+ 0,
495
+ 6,
496
+ 0,
497
+ 0,
498
+ 0,
499
+ 0,
500
+ 6,
501
+ 6,
502
+ 0,
503
+ 0,
504
+ 6,
505
+ 6,
506
+ 6,
507
+ 6,
508
+ 6,
509
+ 6,
510
+ 6,
511
+ 6,
512
+ 6,
513
+ 0,
514
+ 0,
515
+ 6,
516
+ 0,
517
+ 0,
518
+ 0,
519
+ 0,
520
+ 6,
521
+ 6,
522
+ 0,
523
+ 0,
524
+ 6,
525
+ 0,
526
+ 0,
527
+ 0,
528
+ 0,
529
+ 0,
530
+ 0,
531
+ 0,
532
+ 0,
533
+ 0,
534
+ 0,
535
+ 0,
536
+ 0,
537
+ 0,
538
+ 6,
539
+ 0,
540
+ 6,
541
+ 6,
542
+ 0,
543
+ 0,
544
+ 6,
545
+ 0,
546
+ 0,
547
+ 6,
548
+ 6,
549
+ 6,
550
+ 6,
551
+ 6,
552
+ 6,
553
+ 6,
554
+ 6,
555
+ 6,
556
+ 0,
557
+ 0,
558
+ 6,
559
+ 0,
560
+ 6,
561
+ 6,
562
+ 0,
563
+ 0,
564
+ 0,
565
+ 0,
566
+ 0,
567
+ 6,
568
+ 0,
569
+ 0,
570
+ 0,
571
+ 0,
572
+ 0,
573
+ 0,
574
+ 0,
575
+ 6,
576
+ 0,
577
+ 0,
578
+ 0,
579
+ 0,
580
+ 6,
581
+ 6,
582
+ 0,
583
+ 0,
584
+ 0,
585
+ 0,
586
+ 0,
587
+ 6,
588
+ 0,
589
+ 0,
590
+ 0,
591
+ 0,
592
+ 0,
593
+ 0,
594
+ 0,
595
+ 6,
596
+ 0,
597
+ 0,
598
+ 0,
599
+ 0,
600
+ 6,
601
+ 6,
602
+ 6,
603
+ 6,
604
+ 6,
605
+ 6,
606
+ 6,
607
+ 6,
608
+ 6,
609
+ 6,
610
+ 6,
611
+ 6,
612
+ 6,
613
+ 6,
614
+ 6,
615
+ 6,
616
+ 6,
617
+ 6,
618
+ 6,
619
+ 6,
620
+ 6
621
+ ],
622
+ "height": 15,
623
+ "id": 2,
624
+ "name": "Walls",
625
+ "opacity": 1,
626
+ "type": "tilelayer",
627
+ "visible": true,
628
+ "width": 20,
629
+ "x": 0,
630
+ "y": 0
631
+ },
632
+ {
633
+ "draworder": "topdown",
634
+ "id": 3,
635
+ "name": "Markers",
636
+ "objects": [
637
+ {
638
+ "height": 0,
639
+ "id": 1,
640
+ "name": "spawn",
641
+ "point": true,
642
+ "properties": [
643
+ {
644
+ "name": "facing",
645
+ "type": "string",
646
+ "value": "south"
647
+ }
648
+ ],
649
+ "rotation": 0,
650
+ "type": "spawn",
651
+ "visible": true,
652
+ "width": 0,
653
+ "x": 224,
654
+ "y": 160
655
+ }
656
+ ],
657
+ "opacity": 1,
658
+ "type": "objectgroup",
659
+ "visible": true,
660
+ "x": 0,
661
+ "y": 0
662
+ }
663
+ ],
664
+ "nextlayerid": 4,
665
+ "nextobjectid": 2,
666
+ "orientation": "orthogonal",
667
+ "renderorder": "right-down",
668
+ "tiledversion": "1.10.2",
669
+ "tileheight": 64,
670
+ "tilesets": [
671
+ {
672
+ "columns": 17,
673
+ "firstgid": 1,
674
+ "image": "map-pack.png",
675
+ "imageheight": 768,
676
+ "imagewidth": 1088,
677
+ "margin": 0,
678
+ "name": "map-pack",
679
+ "spacing": 0,
680
+ "tilecount": 204,
681
+ "tileheight": 64,
682
+ "tilewidth": 64
683
+ }
684
+ ],
685
+ "tilewidth": 64,
686
+ "type": "map",
687
+ "version": "1.10",
688
+ "width": 20
689
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The level both scenes use, one character per tile: `#` is a wall, `S` is the
3
+ * spawn, everything else is walkable floor.
4
+ *
5
+ * Keeping it here rather than in a scene is what lets the procedural scene and
6
+ * the Tiled scene claim to show the same level. `town-square.tmj` was generated
7
+ * from these rows, so a change here means regenerating that file - see the
8
+ * README.
9
+ */
10
+ export const LEVEL = [
11
+ '####################',
12
+ '# # #',
13
+ '# S # ### #',
14
+ '# # # #',
15
+ '# #### # # #',
16
+ '# # # #### #',
17
+ '# # # #',
18
+ '# ###### # #',
19
+ '# # #',
20
+ '# ######### # #',
21
+ '# # # #',
22
+ '# # ######### # #',
23
+ '# # # #',
24
+ '# # # #',
25
+ '####################',
26
+ ] as const;
27
+
28
+ /** Edge length of one tile, in pixels, matching `town-square.tmj`. */
29
+ export const TILE = 64;
30
+
31
+ export const COLUMNS = LEVEL[0].length;
32
+ export const ROWS = LEVEL.length;
33
+
34
+ export const isWall = (column: number, row: number): boolean => LEVEL[row]?.[column] === '#';
35
+
36
+ /**
37
+ * Traversal cost of one cell for the pathfinder: `0` means impassable, and any
38
+ * positive number is a relative cost.
39
+ */
40
+ export const cellCost = (column: number, row: number): number => (isWall(column, row) ? 0 : 1);
41
+
42
+ /** World-space centre of a tile. */
43
+ export const tileCenter = (column: number, row: number): { x: number; y: number } => ({
44
+ x: (column + 0.5) * TILE,
45
+ y: (row + 0.5) * TILE,
46
+ });
47
+
48
+ /** Tile coordinates of the first occurrence of `marker`. */
49
+ export const findMarker = (marker: string): { column: number; row: number } => {
50
+ for (const [row, line] of LEVEL.entries()) {
51
+ const column = line.indexOf(marker);
52
+
53
+ if (column !== -1) {
54
+ return { column, row };
55
+ }
56
+ }
57
+
58
+ throw new Error(`LEVEL has no ${marker} marker.`);
59
+ };