@ludra/cli 0.5.0 → 0.8.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.
- package/blocks/chasing-enemy/assets/slime.svg +21 -0
- package/blocks/chasing-enemy/block.json +64 -0
- package/blocks/chasing-enemy/demo.json +32 -0
- package/blocks/chasing-enemy/scripts/chaser.ts +19 -0
- package/blocks/coin-row/assets/coin.svg +22 -0
- package/blocks/coin-row/block.json +157 -0
- package/blocks/coin-row/demo.json +15 -0
- package/blocks/falling-platform/assets/falling-platform.svg +13 -0
- package/blocks/falling-platform/block.json +55 -0
- package/blocks/falling-platform/demo.json +24 -0
- package/blocks/falling-platform/scripts/falling-platform.ts +56 -0
- package/blocks/jump-pad/assets/jump-pad.svg +6 -0
- package/blocks/jump-pad/block.json +56 -0
- package/blocks/jump-pad/demo.json +17 -0
- package/blocks/jump-pad/scripts/jump-pad.ts +10 -0
- package/blocks/key-and-door/assets/door.svg +12 -0
- package/blocks/key-and-door/assets/key.svg +9 -0
- package/blocks/key-and-door/block.json +90 -0
- package/blocks/key-and-door/demo.json +31 -0
- package/blocks/key-and-door/scripts/key.ts +12 -0
- package/blocks/key-and-door/scripts/locked-door.ts +15 -0
- package/blocks/moving-platform/assets/lift.svg +9 -0
- package/blocks/moving-platform/block.json +38 -0
- package/blocks/moving-platform/demo.json +27 -0
- package/blocks/patrol-enemy/assets/slime.svg +21 -0
- package/blocks/patrol-enemy/block.json +60 -0
- package/blocks/patrol-enemy/demo.json +22 -0
- package/blocks/spikes/assets/spikes.svg +8 -0
- package/blocks/spikes/block.json +49 -0
- package/blocks/spikes/demo.json +16 -0
- package/blocks/teleporter/assets/teleporter.svg +14 -0
- package/blocks/teleporter/block.json +89 -0
- package/blocks/teleporter/demo.json +17 -0
- package/blocks/teleporter/scripts/teleporter.ts +17 -0
- package/blocks/time-limit/block.json +36 -0
- package/blocks/time-limit/demo.json +25 -0
- package/blocks/time-limit/scripts/time-limit.ts +16 -0
- package/blocks/turret/assets/bullet.svg +5 -0
- package/blocks/turret/assets/turret.svg +10 -0
- package/blocks/turret/block.json +59 -0
- package/blocks/turret/demo.json +35 -0
- package/blocks/turret/scripts/bullet.ts +11 -0
- package/blocks/turret/scripts/turret.ts +36 -0
- package/dist/blocks.d.ts +65 -0
- package/dist/blocks.js +95 -0
- package/dist/commands/blocks.d.ts +12 -0
- package/dist/commands/blocks.js +49 -0
- package/dist/commands/check.d.ts +1 -0
- package/dist/commands/check.js +57 -14
- package/dist/commands/dev.js +7 -2
- package/dist/commands/new.js +1 -1
- package/dist/commands/play.d.ts +1 -0
- package/dist/commands/play.js +12 -4
- package/dist/commands/review.d.ts +22 -0
- package/dist/commands/review.js +183 -0
- package/dist/commands/test.d.ts +1 -0
- package/dist/commands/test.js +20 -5
- package/dist/headless.d.ts +2 -4
- package/dist/headless.js +21 -3
- package/dist/index.js +25 -5
- package/dist/project.d.ts +18 -5
- package/dist/project.js +61 -21
- package/dist/server.js +22 -9
- package/package.json +4 -3
- package/templates/breakout/CLAUDE.md +43 -0
- package/templates/breakout/_gitignore +2 -0
- package/templates/breakout/ludra.json +5 -0
- package/templates/breakout/package.json +13 -0
- package/templates/breakout/scenes/main.scene.json +653 -0
- package/templates/breakout/scripts/backdrop.ts +101 -0
- package/templates/breakout/scripts/ball.ts +89 -0
- package/templates/breakout/scripts/brick.ts +51 -0
- package/templates/breakout/scripts/paddle.ts +53 -0
- package/templates/breakout/scripts/rules.ts +147 -0
- package/templates/breakout/scripts/wall.ts +21 -0
- package/templates/breakout/shaders/neon.frag +42 -0
- package/templates/breakout/tests/gameplay.test.json +31 -0
- package/templates/platformer/CLAUDE.md +13 -8
- package/templates/platformer/assets/lantern.svg +9 -0
- package/templates/platformer/package.json +1 -1
- package/templates/platformer/prefabs/coin.prefab.json +8 -0
- package/templates/platformer/prefabs/slime.prefab.json +9 -0
- package/templates/platformer/scenes/level-2.scene.json +413 -0
- package/templates/platformer/scenes/main.scene.json +356 -59
- package/templates/platformer/scripts/backdrop.ts +75 -0
- package/templates/platformer/scripts/hud.ts +111 -0
- package/templates/platformer/scripts/lantern.ts +35 -0
- package/templates/platformer/shaders/glow.frag +29 -0
- package/templates/platformer/tests/gameplay.test.json +45 -7
- package/templates/platformer/tests/level-2.test.json +49 -0
- package/templates/topdown/CLAUDE.md +39 -0
- package/templates/topdown/_gitignore +2 -0
- package/templates/topdown/assets/gem.svg +16 -0
- package/templates/topdown/assets/grass.svg +8 -0
- package/templates/topdown/assets/hedge.svg +10 -0
- package/templates/topdown/assets/hero.svg +23 -0
- package/templates/topdown/assets/portal.svg +15 -0
- package/templates/topdown/assets/slime.svg +21 -0
- package/templates/topdown/assets/thorns.svg +7 -0
- package/templates/topdown/ludra.json +5 -0
- package/templates/topdown/package.json +13 -0
- package/templates/topdown/scenes/main.scene.json +499 -0
- package/templates/topdown/scripts/hud.ts +94 -0
- package/templates/topdown/scripts/night.ts +67 -0
- package/templates/topdown/scripts/portal.ts +34 -0
- package/templates/topdown/shaders/dream.frag +31 -0
- package/templates/topdown/tests/gameplay.test.json +30 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// A soft, dreamy finish: bloom that makes the lights bleed, a cool-shadow and
|
|
2
|
+
// warm-highlight grade, and a vignette.
|
|
3
|
+
// The engine declares u_image, u_resolution, u_time and v_uv, plus every
|
|
4
|
+
// uniform listed under "postfx.uniforms" in the scene.
|
|
5
|
+
|
|
6
|
+
void main() {
|
|
7
|
+
vec2 pixel = 1.0 / u_resolution;
|
|
8
|
+
vec3 color = texture2D(u_image, v_uv).rgb;
|
|
9
|
+
|
|
10
|
+
// Gaussian-weighted taps: far taps count less, so thin bright text doesn't leave a dotted grid.
|
|
11
|
+
vec3 glow = vec3(0.0);
|
|
12
|
+
float total = 0.0;
|
|
13
|
+
for (int i = -5; i <= 5; i++) {
|
|
14
|
+
for (int j = -5; j <= 5; j++) {
|
|
15
|
+
float weight = exp(-float(i * i + j * j) / 12.0);
|
|
16
|
+
vec2 offset = vec2(float(i), float(j)) * pixel * 2.0;
|
|
17
|
+
glow += max(texture2D(u_image, v_uv + offset).rgb - 0.35, 0.0) * weight;
|
|
18
|
+
total += weight;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
color += glow / total * bloom;
|
|
22
|
+
|
|
23
|
+
// Shadows lean blue, highlights lean gold.
|
|
24
|
+
float luma = dot(color, vec3(0.299, 0.587, 0.114));
|
|
25
|
+
color = mix(color * vec3(0.9, 0.97, 1.12), color * vec3(1.08, 1.0, 0.88), smoothstep(0.2, 0.8, luma) * warmth);
|
|
26
|
+
|
|
27
|
+
vec2 centered = v_uv - 0.5;
|
|
28
|
+
color *= 1.0 - vignette * dot(centered, centered) * 1.6;
|
|
29
|
+
|
|
30
|
+
gl_FragColor = vec4(color, 1.0);
|
|
31
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tests": [
|
|
3
|
+
{
|
|
4
|
+
"name": "the hero stays put without input (no gravity in a top-down game)",
|
|
5
|
+
"duration": "1s",
|
|
6
|
+
"assert": ["hero.x == 80", "hero.y == 270", "deaths == 0"]
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "the hero moves diagonally",
|
|
10
|
+
"inputs": "right+down:0.5s",
|
|
11
|
+
"duration": "0.5s",
|
|
12
|
+
"assert": ["hero.x > 130", "hero.y > 320"]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "hedges block the hero",
|
|
16
|
+
"inputs": "right:3s",
|
|
17
|
+
"assert": ["hero.x < 270", "deaths == 0"]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "rushing through the middle corridor gets the hero caught by the slime",
|
|
21
|
+
"inputs": "up:1s, right:0.39s, down:2s, right:0.17s, right:1.61s, left:0.5s, wait:0.1s, up:1.95s",
|
|
22
|
+
"assert": ["deaths == 1", "events.die == 1"]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "the grove can be cleared without dying",
|
|
26
|
+
"inputs": "up:1s, right:0.39s, down:2s, right:0.17s, right:1.61s, left:0.5s, wait:1.5s, up:1.95s, right:0.5s, right:1.94s, right:0.44s, wait:1.2s, down:2s",
|
|
27
|
+
"assert": ["won == true", "deaths == 0", "score == 5"]
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|