create-bloop 0.0.7 → 0.0.9
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
|
@@ -52,14 +52,14 @@ export function createDrawState(toodle: Toodle): DrawState {
|
|
|
52
52
|
// Title screen container
|
|
53
53
|
const titleScreen = root.add(toodle.Node({}));
|
|
54
54
|
const titleText = titleScreen.add(
|
|
55
|
-
toodle.Text("
|
|
55
|
+
toodle.Text("Roboto", "MARIO ROLLBACK", {
|
|
56
56
|
fontSize: 24,
|
|
57
57
|
color: { r: 1, g: 1, b: 1, a: 1 },
|
|
58
58
|
position: { x: 0, y: 20 },
|
|
59
59
|
}),
|
|
60
60
|
);
|
|
61
61
|
const subtitleText = titleScreen.add(
|
|
62
|
-
toodle.Text("
|
|
62
|
+
toodle.Text("Roboto", "[Space] Local [Enter] Online", {
|
|
63
63
|
fontSize: 10,
|
|
64
64
|
color: { r: 1, g: 1, b: 1, a: 1 },
|
|
65
65
|
position: { x: 0, y: 0 },
|
|
@@ -121,14 +121,14 @@ export function createDrawState(toodle: Toodle): DrawState {
|
|
|
121
121
|
const p2 = createPoseQuads(LUIGI_COLOR);
|
|
122
122
|
|
|
123
123
|
const p1Score = gameScreen.add(
|
|
124
|
-
toodle.Text("
|
|
124
|
+
toodle.Text("Roboto", "P9: 0", {
|
|
125
125
|
fontSize: 16,
|
|
126
126
|
color: MARIO_COLOR,
|
|
127
127
|
}),
|
|
128
128
|
);
|
|
129
129
|
|
|
130
130
|
const p2Score = gameScreen.add(
|
|
131
|
-
toodle.Text("
|
|
131
|
+
toodle.Text("Roboto", "P2: 0", {
|
|
132
132
|
fontSize: 16,
|
|
133
133
|
color: LUIGI_COLOR,
|
|
134
134
|
}),
|
|
@@ -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
|
|
|
@@ -44,8 +43,8 @@ await toodle.assets.registerBundle("main", {
|
|
|
44
43
|
});
|
|
45
44
|
|
|
46
45
|
await toodle.assets.loadFont(
|
|
47
|
-
"
|
|
48
|
-
new URL("https://toodle.gg/fonts/
|
|
46
|
+
"Roboto",
|
|
47
|
+
new URL("https://toodle.gg/fonts/Roboto-Regular-msdf.json"),
|
|
49
48
|
);
|
|
50
49
|
|
|
51
50
|
const drawState = createDrawState(toodle);
|
|
@@ -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 }) {
|
|
@@ -78,8 +78,8 @@ async function loadTape(bytes: Uint8Array, fileName: string) {
|
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
await toodle.assets.loadFont(
|
|
81
|
-
"
|
|
82
|
-
new URL("https://toodle.gg/fonts/
|
|
81
|
+
"Roboto",
|
|
82
|
+
new URL("https://toodle.gg/fonts/Roboto-Regular-msdf.json"),
|
|
83
83
|
);
|
|
84
84
|
|
|
85
85
|
const drawState = createDrawState(toodle);
|