create-bloop 0.0.7 → 0.0.8
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/package.json
CHANGED
|
@@ -20,7 +20,6 @@ if (!canvas) throw new Error("No canvas element found");
|
|
|
20
20
|
|
|
21
21
|
const toodle = await Toodle.attach(canvas, {
|
|
22
22
|
filter: "nearest",
|
|
23
|
-
backend: "webgpu",
|
|
24
23
|
limits: { textureArrayLayers: 5 },
|
|
25
24
|
});
|
|
26
25
|
|
|
@@ -65,15 +64,17 @@ window.addEventListener("keydown", (e) => {
|
|
|
65
64
|
}
|
|
66
65
|
});
|
|
67
66
|
|
|
68
|
-
// Debug: Press G to toggle glitch effect
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
67
|
+
// Debug: Press G to toggle glitch effect on webgpu backend
|
|
68
|
+
if (toodle.backend.type === "webgpu") {
|
|
69
|
+
const glitchEffect = createChromaticAberrationEffect(toodle);
|
|
70
|
+
let glitchEnabled = false;
|
|
71
|
+
window.addEventListener("keydown", (e) => {
|
|
72
|
+
if (e.key === "g") {
|
|
73
|
+
glitchEnabled = !glitchEnabled;
|
|
74
|
+
toodle.postprocess = glitchEnabled ? glitchEffect : null;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
77
78
|
|
|
78
79
|
game.system("title-input", {
|
|
79
80
|
update({ bag, inputs }) {
|