@ludra/cli 0.4.0 → 0.7.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 (94) hide show
  1. package/blocks/chasing-enemy/assets/slime.svg +21 -0
  2. package/blocks/chasing-enemy/block.json +64 -0
  3. package/blocks/chasing-enemy/demo.json +32 -0
  4. package/blocks/chasing-enemy/scripts/chaser.ts +19 -0
  5. package/blocks/coin-row/assets/coin.svg +22 -0
  6. package/blocks/coin-row/block.json +157 -0
  7. package/blocks/coin-row/demo.json +15 -0
  8. package/blocks/falling-platform/assets/falling-platform.svg +13 -0
  9. package/blocks/falling-platform/block.json +55 -0
  10. package/blocks/falling-platform/demo.json +24 -0
  11. package/blocks/falling-platform/scripts/falling-platform.ts +56 -0
  12. package/blocks/jump-pad/assets/jump-pad.svg +6 -0
  13. package/blocks/jump-pad/block.json +56 -0
  14. package/blocks/jump-pad/demo.json +17 -0
  15. package/blocks/jump-pad/scripts/jump-pad.ts +10 -0
  16. package/blocks/key-and-door/assets/door.svg +12 -0
  17. package/blocks/key-and-door/assets/key.svg +9 -0
  18. package/blocks/key-and-door/block.json +90 -0
  19. package/blocks/key-and-door/demo.json +31 -0
  20. package/blocks/key-and-door/scripts/key.ts +12 -0
  21. package/blocks/key-and-door/scripts/locked-door.ts +15 -0
  22. package/blocks/moving-platform/assets/lift.svg +9 -0
  23. package/blocks/moving-platform/block.json +38 -0
  24. package/blocks/moving-platform/demo.json +27 -0
  25. package/blocks/patrol-enemy/assets/slime.svg +21 -0
  26. package/blocks/patrol-enemy/block.json +60 -0
  27. package/blocks/patrol-enemy/demo.json +22 -0
  28. package/blocks/spikes/assets/spikes.svg +8 -0
  29. package/blocks/spikes/block.json +49 -0
  30. package/blocks/spikes/demo.json +16 -0
  31. package/blocks/teleporter/assets/teleporter.svg +14 -0
  32. package/blocks/teleporter/block.json +89 -0
  33. package/blocks/teleporter/demo.json +17 -0
  34. package/blocks/teleporter/scripts/teleporter.ts +17 -0
  35. package/blocks/time-limit/block.json +36 -0
  36. package/blocks/time-limit/demo.json +25 -0
  37. package/blocks/time-limit/scripts/time-limit.ts +16 -0
  38. package/blocks/turret/assets/bullet.svg +5 -0
  39. package/blocks/turret/assets/turret.svg +10 -0
  40. package/blocks/turret/block.json +59 -0
  41. package/blocks/turret/demo.json +35 -0
  42. package/blocks/turret/scripts/bullet.ts +11 -0
  43. package/blocks/turret/scripts/turret.ts +36 -0
  44. package/dist/blocks.d.ts +65 -0
  45. package/dist/blocks.js +95 -0
  46. package/dist/commands/blocks.d.ts +12 -0
  47. package/dist/commands/blocks.js +49 -0
  48. package/dist/commands/check.d.ts +1 -1
  49. package/dist/commands/check.js +8 -3
  50. package/dist/commands/components.js +5 -1
  51. package/dist/commands/dev.js +3 -2
  52. package/dist/commands/new.js +1 -1
  53. package/dist/commands/play.js +25 -9
  54. package/dist/commands/test.d.ts +1 -1
  55. package/dist/commands/test.js +4 -4
  56. package/dist/headless.js +6 -1
  57. package/dist/index.js +23 -3
  58. package/dist/project.d.ts +17 -1
  59. package/dist/project.js +91 -8
  60. package/dist/server.d.ts +1 -0
  61. package/dist/server.js +27 -2
  62. package/package.json +4 -3
  63. package/templates/breakout/CLAUDE.md +42 -0
  64. package/templates/breakout/_gitignore +2 -0
  65. package/templates/breakout/ludra.json +5 -0
  66. package/templates/breakout/package.json +13 -0
  67. package/templates/breakout/scenes/main.scene.json +648 -0
  68. package/templates/breakout/scripts/backdrop.ts +101 -0
  69. package/templates/breakout/scripts/ball.ts +90 -0
  70. package/templates/breakout/scripts/brick.ts +51 -0
  71. package/templates/breakout/scripts/paddle.ts +53 -0
  72. package/templates/breakout/scripts/rules.ts +128 -0
  73. package/templates/breakout/scripts/wall.ts +21 -0
  74. package/templates/breakout/shaders/neon.frag +42 -0
  75. package/templates/breakout/tests/gameplay.test.json +31 -0
  76. package/templates/platformer/CLAUDE.md +4 -1
  77. package/templates/platformer/package.json +1 -1
  78. package/templates/topdown/CLAUDE.md +38 -0
  79. package/templates/topdown/_gitignore +2 -0
  80. package/templates/topdown/assets/gem.svg +16 -0
  81. package/templates/topdown/assets/grass.svg +8 -0
  82. package/templates/topdown/assets/hedge.svg +10 -0
  83. package/templates/topdown/assets/hero.svg +23 -0
  84. package/templates/topdown/assets/portal.svg +15 -0
  85. package/templates/topdown/assets/slime.svg +21 -0
  86. package/templates/topdown/assets/thorns.svg +7 -0
  87. package/templates/topdown/ludra.json +5 -0
  88. package/templates/topdown/package.json +13 -0
  89. package/templates/topdown/scenes/main.scene.json +499 -0
  90. package/templates/topdown/scripts/hud.ts +94 -0
  91. package/templates/topdown/scripts/night.ts +67 -0
  92. package/templates/topdown/scripts/portal.ts +34 -0
  93. package/templates/topdown/shaders/dream.frag +31 -0
  94. package/templates/topdown/tests/gameplay.test.json +30 -0
@@ -0,0 +1,648 @@
1
+ {
2
+ "name": "Neon Breakout",
3
+ "world": {
4
+ "width": 960,
5
+ "height": 540,
6
+ "gravity": 0,
7
+ "background": "#05001a"
8
+ },
9
+ "fonts": {
10
+ "Orbitron": "google"
11
+ },
12
+ "postfx": {
13
+ "shader": "shaders/neon.frag",
14
+ "uniforms": {
15
+ "bloom": 1.6,
16
+ "aberration": 0.8,
17
+ "scanlines": 0.5,
18
+ "curve": 0.08,
19
+ "vignette": 0.9
20
+ }
21
+ },
22
+ "effects": {
23
+ "bounce": {
24
+ "sound": "blip",
25
+ "particles": {
26
+ "count": 5,
27
+ "color": "#fff3b0",
28
+ "speed": 80,
29
+ "life": 0.25,
30
+ "size": 2,
31
+ "gravity": 0
32
+ }
33
+ },
34
+ "brick": {
35
+ "sound": "hit",
36
+ "shake": 4
37
+ },
38
+ "launch": {
39
+ "sound": "jump"
40
+ },
41
+ "ball-lost": {
42
+ "sound": "explosion",
43
+ "shake": 10
44
+ },
45
+ "win": {
46
+ "sound": "powerup",
47
+ "shake": 4,
48
+ "particles": {
49
+ "count": 80,
50
+ "color": "#00f0ff",
51
+ "speed": 320,
52
+ "life": 1.4,
53
+ "size": 4,
54
+ "gravity": 0
55
+ }
56
+ }
57
+ },
58
+ "entities": [
59
+ {
60
+ "id": "backdrop",
61
+ "components": {
62
+ "transform": {
63
+ "x": 480,
64
+ "y": 270
65
+ },
66
+ "script": {
67
+ "src": "scripts/backdrop.ts"
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "id": "wall-left",
73
+ "components": {
74
+ "transform": {
75
+ "x": 10,
76
+ "y": 270
77
+ },
78
+ "body": {
79
+ "type": "static",
80
+ "width": 20,
81
+ "height": 540
82
+ },
83
+ "script": {
84
+ "src": "scripts/wall.ts"
85
+ }
86
+ }
87
+ },
88
+ {
89
+ "id": "wall-right",
90
+ "components": {
91
+ "transform": {
92
+ "x": 950,
93
+ "y": 270
94
+ },
95
+ "body": {
96
+ "type": "static",
97
+ "width": 20,
98
+ "height": 540
99
+ },
100
+ "script": {
101
+ "src": "scripts/wall.ts"
102
+ }
103
+ }
104
+ },
105
+ {
106
+ "id": "wall-top",
107
+ "components": {
108
+ "transform": {
109
+ "x": 480,
110
+ "y": 10
111
+ },
112
+ "body": {
113
+ "type": "static",
114
+ "width": 960,
115
+ "height": 20
116
+ },
117
+ "script": {
118
+ "src": "scripts/wall.ts"
119
+ }
120
+ }
121
+ },
122
+ {
123
+ "id": "brick-1-1",
124
+ "components": {
125
+ "transform": {
126
+ "x": 120,
127
+ "y": 80
128
+ },
129
+ "body": {
130
+ "type": "static",
131
+ "width": 110,
132
+ "height": 28
133
+ },
134
+ "script": {
135
+ "src": "scripts/brick.ts",
136
+ "params": {
137
+ "ball": "ball",
138
+ "points": 3,
139
+ "color": "#ff2a6d"
140
+ }
141
+ }
142
+ }
143
+ },
144
+ {
145
+ "id": "brick-1-2",
146
+ "components": {
147
+ "transform": {
148
+ "x": 240,
149
+ "y": 80
150
+ },
151
+ "body": {
152
+ "type": "static",
153
+ "width": 110,
154
+ "height": 28
155
+ },
156
+ "script": {
157
+ "src": "scripts/brick.ts",
158
+ "params": {
159
+ "ball": "ball",
160
+ "points": 3,
161
+ "color": "#ff2a6d"
162
+ }
163
+ }
164
+ }
165
+ },
166
+ {
167
+ "id": "brick-1-3",
168
+ "components": {
169
+ "transform": {
170
+ "x": 360,
171
+ "y": 80
172
+ },
173
+ "body": {
174
+ "type": "static",
175
+ "width": 110,
176
+ "height": 28
177
+ },
178
+ "script": {
179
+ "src": "scripts/brick.ts",
180
+ "params": {
181
+ "ball": "ball",
182
+ "points": 3,
183
+ "color": "#ff2a6d"
184
+ }
185
+ }
186
+ }
187
+ },
188
+ {
189
+ "id": "brick-1-4",
190
+ "components": {
191
+ "transform": {
192
+ "x": 480,
193
+ "y": 80
194
+ },
195
+ "body": {
196
+ "type": "static",
197
+ "width": 110,
198
+ "height": 28
199
+ },
200
+ "script": {
201
+ "src": "scripts/brick.ts",
202
+ "params": {
203
+ "ball": "ball",
204
+ "points": 3,
205
+ "color": "#ff2a6d"
206
+ }
207
+ }
208
+ }
209
+ },
210
+ {
211
+ "id": "brick-1-5",
212
+ "components": {
213
+ "transform": {
214
+ "x": 600,
215
+ "y": 80
216
+ },
217
+ "body": {
218
+ "type": "static",
219
+ "width": 110,
220
+ "height": 28
221
+ },
222
+ "script": {
223
+ "src": "scripts/brick.ts",
224
+ "params": {
225
+ "ball": "ball",
226
+ "points": 3,
227
+ "color": "#ff2a6d"
228
+ }
229
+ }
230
+ }
231
+ },
232
+ {
233
+ "id": "brick-1-6",
234
+ "components": {
235
+ "transform": {
236
+ "x": 720,
237
+ "y": 80
238
+ },
239
+ "body": {
240
+ "type": "static",
241
+ "width": 110,
242
+ "height": 28
243
+ },
244
+ "script": {
245
+ "src": "scripts/brick.ts",
246
+ "params": {
247
+ "ball": "ball",
248
+ "points": 3,
249
+ "color": "#ff2a6d"
250
+ }
251
+ }
252
+ }
253
+ },
254
+ {
255
+ "id": "brick-1-7",
256
+ "components": {
257
+ "transform": {
258
+ "x": 840,
259
+ "y": 80
260
+ },
261
+ "body": {
262
+ "type": "static",
263
+ "width": 110,
264
+ "height": 28
265
+ },
266
+ "script": {
267
+ "src": "scripts/brick.ts",
268
+ "params": {
269
+ "ball": "ball",
270
+ "points": 3,
271
+ "color": "#ff2a6d"
272
+ }
273
+ }
274
+ }
275
+ },
276
+ {
277
+ "id": "brick-2-1",
278
+ "components": {
279
+ "transform": {
280
+ "x": 120,
281
+ "y": 118
282
+ },
283
+ "body": {
284
+ "type": "static",
285
+ "width": 110,
286
+ "height": 28
287
+ },
288
+ "script": {
289
+ "src": "scripts/brick.ts",
290
+ "params": {
291
+ "ball": "ball",
292
+ "points": 2,
293
+ "color": "#b14aed"
294
+ }
295
+ }
296
+ }
297
+ },
298
+ {
299
+ "id": "brick-2-2",
300
+ "components": {
301
+ "transform": {
302
+ "x": 240,
303
+ "y": 118
304
+ },
305
+ "body": {
306
+ "type": "static",
307
+ "width": 110,
308
+ "height": 28
309
+ },
310
+ "script": {
311
+ "src": "scripts/brick.ts",
312
+ "params": {
313
+ "ball": "ball",
314
+ "points": 2,
315
+ "color": "#b14aed"
316
+ }
317
+ }
318
+ }
319
+ },
320
+ {
321
+ "id": "brick-2-3",
322
+ "components": {
323
+ "transform": {
324
+ "x": 360,
325
+ "y": 118
326
+ },
327
+ "body": {
328
+ "type": "static",
329
+ "width": 110,
330
+ "height": 28
331
+ },
332
+ "script": {
333
+ "src": "scripts/brick.ts",
334
+ "params": {
335
+ "ball": "ball",
336
+ "points": 2,
337
+ "color": "#b14aed"
338
+ }
339
+ }
340
+ }
341
+ },
342
+ {
343
+ "id": "brick-2-4",
344
+ "components": {
345
+ "transform": {
346
+ "x": 480,
347
+ "y": 118
348
+ },
349
+ "body": {
350
+ "type": "static",
351
+ "width": 110,
352
+ "height": 28
353
+ },
354
+ "script": {
355
+ "src": "scripts/brick.ts",
356
+ "params": {
357
+ "ball": "ball",
358
+ "points": 2,
359
+ "color": "#b14aed"
360
+ }
361
+ }
362
+ }
363
+ },
364
+ {
365
+ "id": "brick-2-5",
366
+ "components": {
367
+ "transform": {
368
+ "x": 600,
369
+ "y": 118
370
+ },
371
+ "body": {
372
+ "type": "static",
373
+ "width": 110,
374
+ "height": 28
375
+ },
376
+ "script": {
377
+ "src": "scripts/brick.ts",
378
+ "params": {
379
+ "ball": "ball",
380
+ "points": 2,
381
+ "color": "#b14aed"
382
+ }
383
+ }
384
+ }
385
+ },
386
+ {
387
+ "id": "brick-2-6",
388
+ "components": {
389
+ "transform": {
390
+ "x": 720,
391
+ "y": 118
392
+ },
393
+ "body": {
394
+ "type": "static",
395
+ "width": 110,
396
+ "height": 28
397
+ },
398
+ "script": {
399
+ "src": "scripts/brick.ts",
400
+ "params": {
401
+ "ball": "ball",
402
+ "points": 2,
403
+ "color": "#b14aed"
404
+ }
405
+ }
406
+ }
407
+ },
408
+ {
409
+ "id": "brick-2-7",
410
+ "components": {
411
+ "transform": {
412
+ "x": 840,
413
+ "y": 118
414
+ },
415
+ "body": {
416
+ "type": "static",
417
+ "width": 110,
418
+ "height": 28
419
+ },
420
+ "script": {
421
+ "src": "scripts/brick.ts",
422
+ "params": {
423
+ "ball": "ball",
424
+ "points": 2,
425
+ "color": "#b14aed"
426
+ }
427
+ }
428
+ }
429
+ },
430
+ {
431
+ "id": "brick-3-1",
432
+ "components": {
433
+ "transform": {
434
+ "x": 120,
435
+ "y": 156
436
+ },
437
+ "body": {
438
+ "type": "static",
439
+ "width": 110,
440
+ "height": 28
441
+ },
442
+ "script": {
443
+ "src": "scripts/brick.ts",
444
+ "params": {
445
+ "ball": "ball",
446
+ "points": 1,
447
+ "color": "#00e5ff"
448
+ }
449
+ }
450
+ }
451
+ },
452
+ {
453
+ "id": "brick-3-2",
454
+ "components": {
455
+ "transform": {
456
+ "x": 240,
457
+ "y": 156
458
+ },
459
+ "body": {
460
+ "type": "static",
461
+ "width": 110,
462
+ "height": 28
463
+ },
464
+ "script": {
465
+ "src": "scripts/brick.ts",
466
+ "params": {
467
+ "ball": "ball",
468
+ "points": 1,
469
+ "color": "#00e5ff"
470
+ }
471
+ }
472
+ }
473
+ },
474
+ {
475
+ "id": "brick-3-3",
476
+ "components": {
477
+ "transform": {
478
+ "x": 360,
479
+ "y": 156
480
+ },
481
+ "body": {
482
+ "type": "static",
483
+ "width": 110,
484
+ "height": 28
485
+ },
486
+ "script": {
487
+ "src": "scripts/brick.ts",
488
+ "params": {
489
+ "ball": "ball",
490
+ "points": 1,
491
+ "color": "#00e5ff"
492
+ }
493
+ }
494
+ }
495
+ },
496
+ {
497
+ "id": "brick-3-4",
498
+ "components": {
499
+ "transform": {
500
+ "x": 480,
501
+ "y": 156
502
+ },
503
+ "body": {
504
+ "type": "static",
505
+ "width": 110,
506
+ "height": 28
507
+ },
508
+ "script": {
509
+ "src": "scripts/brick.ts",
510
+ "params": {
511
+ "ball": "ball",
512
+ "points": 1,
513
+ "color": "#00e5ff"
514
+ }
515
+ }
516
+ }
517
+ },
518
+ {
519
+ "id": "brick-3-5",
520
+ "components": {
521
+ "transform": {
522
+ "x": 600,
523
+ "y": 156
524
+ },
525
+ "body": {
526
+ "type": "static",
527
+ "width": 110,
528
+ "height": 28
529
+ },
530
+ "script": {
531
+ "src": "scripts/brick.ts",
532
+ "params": {
533
+ "ball": "ball",
534
+ "points": 1,
535
+ "color": "#00e5ff"
536
+ }
537
+ }
538
+ }
539
+ },
540
+ {
541
+ "id": "brick-3-6",
542
+ "components": {
543
+ "transform": {
544
+ "x": 720,
545
+ "y": 156
546
+ },
547
+ "body": {
548
+ "type": "static",
549
+ "width": 110,
550
+ "height": 28
551
+ },
552
+ "script": {
553
+ "src": "scripts/brick.ts",
554
+ "params": {
555
+ "ball": "ball",
556
+ "points": 1,
557
+ "color": "#00e5ff"
558
+ }
559
+ }
560
+ }
561
+ },
562
+ {
563
+ "id": "brick-3-7",
564
+ "components": {
565
+ "transform": {
566
+ "x": 840,
567
+ "y": 156
568
+ },
569
+ "body": {
570
+ "type": "static",
571
+ "width": 110,
572
+ "height": 28
573
+ },
574
+ "script": {
575
+ "src": "scripts/brick.ts",
576
+ "params": {
577
+ "ball": "ball",
578
+ "points": 1,
579
+ "color": "#00e5ff"
580
+ }
581
+ }
582
+ }
583
+ },
584
+ {
585
+ "id": "paddle",
586
+ "components": {
587
+ "transform": {
588
+ "x": 480,
589
+ "y": 500
590
+ },
591
+ "body": {
592
+ "type": "kinematic",
593
+ "width": 120,
594
+ "height": 16
595
+ },
596
+ "topdown": {
597
+ "speed": 480,
598
+ "directions": "x"
599
+ },
600
+ "script": {
601
+ "src": "scripts/paddle.ts",
602
+ "params": {
603
+ "ball": "ball"
604
+ }
605
+ }
606
+ }
607
+ },
608
+ {
609
+ "id": "ball",
610
+ "components": {
611
+ "transform": {
612
+ "x": 480,
613
+ "y": 484
614
+ },
615
+ "body": {
616
+ "type": "dynamic",
617
+ "width": 14,
618
+ "height": 14,
619
+ "bounce": 1,
620
+ "gravityScale": 0
621
+ },
622
+ "script": {
623
+ "src": "scripts/ball.ts",
624
+ "params": {
625
+ "speed": 420,
626
+ "launchDelay": 0.6,
627
+ "paddle": "paddle"
628
+ }
629
+ }
630
+ }
631
+ },
632
+ {
633
+ "id": "rules",
634
+ "components": {
635
+ "transform": {
636
+ "x": 0,
637
+ "y": 0
638
+ },
639
+ "script": {
640
+ "src": "scripts/rules.ts",
641
+ "params": {
642
+ "prefix": "brick-"
643
+ }
644
+ }
645
+ }
646
+ }
647
+ ]
648
+ }