Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addChild')' in or related to this line: 'LK.gui.center.top.addChild(scoreTxt);' Line Number: 40
Code edit (1 edits merged)
Please save this source code
Initial prompt
Starfield
===================================================================
--- original.js
+++ change.js
@@ -31,9 +31,9 @@
size: 100,
fill: "#ffffff",
anchorX: 0.5
});
-LK.gui.top.addChild(scoreTxt);
+LK.gui.centerTop.addChild(scoreTxt);
// Drag character
// Game tick
LK.on('tick', function () {
// Spawn obstacles and stars
A white triangle pointing down.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A colorful rectangular button with the text "Play Again" with each letter in a different color picked from a nice palette.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.