User prompt
Please fix the bug: 'TypeError: arr.slice is not a function' in or related to this line: 'return arr.slice();' Line Number: 853
Code edit (16 edits merged)
Please save this source code
User prompt
Please fix the bug: 'l5 is not defined' in or related to this line: 'var levels = [l1a, l5a, l1b, l1c, l1d, l1e, l1f, l1g, l2a, l2b, l2c, l2d, l2e, l2f, l2g, l3a, l4a, l5];' Line Number: 444
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (11 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: t is not defined' in or related to this line: 't.width = tileSize;' Line Number: 192
Code edit (1 edits merged)
Please save this source code
User prompt
in game state == 5, call lk.gameover after a 300 ms delay
Code edit (21 edits merged)
Please save this source code
User prompt
where it says 'make the t objects flash red' in the code, please make it do so
Code edit (1 edits merged)
Please save this source code
User prompt
please place a score label above the boad on the right side, and under it, a highest score label,somewhat smaller
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Error: Invalid end type for property x: undefined' in or related to this line: 'tween(self, {' Line Number: 173
Code edit (7 edits merged)
Please save this source code
User prompt
on gameover, please compare the playerscore to any previously stored highscore, using the storage plugin, and store the new highscore if it is indeed higher than the previous score. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'setItem')' in or related to this line: 'localStorage.setItem('highscore', playerScore);' Line Number: 679
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'setItem')' in or related to this line: 'localStorage.setItem('highscore', playerScore);' Line Number: 675
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'setItem')' in or related to this line: 'localStorage.setItem('highscore', playerScore);' Line Number: 671
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting '3')' in or related to this line: 'currentLevel[self.gridY][self.gridX] = self.colorIndex;' Line Number: 189
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'for (var i = 0; i < a.length; i++) {' Line Number: 357
===================================================================
--- original.js
+++ change.js
@@ -381,10 +381,8 @@
levelLabel.x = 1024; // Position near the right edge
levelLabel.y = 100; // Position at the top
//LK.gui.topRight.addChild(scoreLabel);
game.addChild(levelLabel);
-// 0 black 1 white 2 yellow 3 red 4 blue 5 green 6 purple 7 grey 8 brown
-var colors = ['0x000000', '0xffffff', '0xffff00', '0xff0000', '0x000055', '0x00ff00', '0xff00ff', '0xdddddd', '0x827364'];
var gridSize = 5;
var spacingRatio = 0.2;
var boardSize = 1300;
function calculateTileSize() {
@@ -398,22 +396,40 @@
var board = new Board();
board.x = 1024;
board.y = 2732 / 2;
game.addChild(board);
+// 0 black 1 white 2 yellow 3 red 4 blue 5 green 6 purple 7 grey 8 brown 9 skin
+var colors = ['0x000000', '0xffffff', '0xffff00', '0xff0000', '0x000055', '0x00ff00', '0xff00ff', '0xdddddd', '0x827364', '0xecbcb4'];
+// 5x5 levels.
var l1a = [[0, 0, 0, 0, 0], [0, 0, 1, 0, 0], [0, 1, 2, 1, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0]];
var l1b = [[0, 0, 0, 0, 0], [0, 0, 4, 0, 0], [0, 5, 4, 5, 0], [0, 5, 0, 5, 0], [0, 0, 0, 0, 0]];
var l1c = [[0, 0, 0, 0, 0], [0, 3, 0, 3, 0], [0, 0, 2, 0, 0], [0, 3, 0, 3, 0], [0, 0, 0, 0, 0]];
var l1d = [[0, 0, 0, 0, 0], [0, 6, 4, 6, 0], [0, 4, 0, 4, 0], [0, 6, 4, 6, 0], [0, 0, 0, 0, 0]];
var l1e = [[0, 0, 0, 0, 0], [0, 0, 0, 5, 0], [0, 0, 5, 3, 0], [0, 5, 3, 3, 0], [0, 0, 0, 0, 0]];
var l1f = [[0, 0, 7, 7, 7], [0, 0, 0, 8, 7], [0, 0, 8, 0, 7], [0, 8, 0, 0, 0], [0, 0, 0, 0, 0]];
-var l1g = [[0, 0, 1, 0, 0], [0, 0, 3, 0, 0], [0, 3, 3, 3, 0], [0, 3, 3, 3, 0], [0, 1, 1, 1, 0]];
-var l2 = [[0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0], [0, 4, 1, 1, 4, 0], [0, 0, 2, 2, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
-var l3 = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0], [0, 0, 2, 2, 0, 0, 0], [0, 0, 1, 1, 0, 0, 0], [0, 0, 2, 2, 0, 0, 0], [0, 2, 2, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
+var l1g = [[0, 0, 1, 0, 0], [0, 0, 3, 0, 0], [0, 3, 3, 3, 0], [0, 1, 1, 1, 0], [0, 0, 0, 0, 0]];
+// 6x6 levels
+var l2a = [[0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0], [0, 4, 1, 1, 4, 0], [0, 0, 2, 2, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]];
+var l2b = [[0, 0, 0, 0, 0, 0], [0, 0, 8, 8, 0, 0], [0, 8, 8, 8, 6, 0], [0, 8, 8, 8, 8, 0], [0, 9, 0, 0, 9, 0], [0, 0, 0, 0, 0, 0]];
+var l2c = [[0, 0, 0, 0, 0, 0], [0, 9, 9, 9, 9, 0], [0, 4, 9, 9, 4, 0], [0, 9, 6, 6, 9, 0], [0, 9, 9, 9, 9, 0], [0, 0, 0, 0, 0, 0]];
+var l2d = [[0, 0, 0, 0, 0, 0], [0, 4, 2, 2, 4, 0], [0, 0, 3, 2, 0, 0], [0, 2, 2, 2, 2, 0], [0, 2, 2, 2, 0, 0], [0, 0, 0, 0, 0, 0]];
+var l2e = [[0, 0, 0, 0, 0, 0], [0, 5, 5, 6, 0, 0], [0, 5, 6, 3, 6, 0], [0, 6, 3, 6, 3, 0], [0, 0, 6, 3, 6, 0], [0, 0, 0, 0, 0, 0]];
+var l2f = [[0, 0, 0, 0, 0, 0], [0, 7, 0, 7, 0, 0], [0, 7, 4, 7, 4, 0], [0, 7, 7, 3, 7, 0], [0, 0, 7, 7, 0, 0], [0, 0, 0, 0, 0, 0]];
+var l2g = [[0, 0, 0, 0, 0, 0], [0, 3, 0, 3, 2, 0], [0, 3, 3, 2, 9, 0], [0, 3, 3, 2, 0, 0], [0, 3, 0, 3, 0, 0], [0, 0, 0, 0, 0, 0]];
+// 7x7 levels
+var l3a = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 8, 0, 8, 0, 0], [0, 8, 8, 0, 8, 8, 0], [0, 0, 7, 7, 7, 0, 0], [0, 0, 4, 7, 4, 0, 0], [0, 0, 0, 3, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
+var l3b = [[0, 0, 0, 0, 0, 0, 0], [0, 3, 3, 3, 3, 3, 0], [0, 3, 3, 9, 9, 3, 0], [0, 3, 4, 9, 4, 3, 0], [0, 3, 9, 9, 9, 3, 0], [0, 3, 9, 9, 9, 3, 0], [0, 0, 0, 0, 0, 0, 0]];
+var l3c = [[0, 0, 0, 0, 0, 0, 0], [0, 7, 9, 9, 9, 7, 0], [0, 7, 5, 9, 5, 7, 0], [0, 9, 9, 9, 9, 9, 0], [0, 9, 6, 6, 6, 9, 0], [0, 0, 9, 9, 9, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
+var l3d = [[0, 0, 0, 0, 0, 0, 0], [0, 2, 0, 0, 0, 2, 0], [0, 2, 1, 0, 2, 2, 0], [0, 2, 2, 2, 2, 2, 0], [0, 3, 8, 3, 8, 3, 0], [0, 8, 2, 2, 2, 8, 0], [0, 0, 0, 0, 0, 0, 0]];
+var l3e = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 6, 6, 6, 0, 0], [0, 6, 3, 2, 3, 6, 0], [0, 6, 2, 2, 2, 6, 0], [0, 6, 3, 2, 3, 6, 0], [0, 0, 6, 6, 6, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
+var l3f = [[0, 0, 0, 0, 0, 0, 0], [0, 0, 8, 8, 2, 0, 0], [0, 0, 7, 9, 2, 0, 0], [0, 7, 8, 8, 8, 7, 0], [0, 0, 8, 8, 8, 0, 0], [0, 0, 8, 0, 8, 0, 0], [0, 0, 0, 0, 0, 0, 0]];
+// 8x8 levels
var l4 = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 0, 0, 0], [0, 0, 2, 2, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 0, 0], [0, 0, 2, 2, 0, 0, 0, 0], [0, 2, 2, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]];
+// 9x9 levels
var l5 = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 3, 3, 3, 0], [0, 0, 2, 2, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0, 0, 0, 0], [0, 0, 2, 2, 0, 0, 0, 0, 0], [0, 2, 2, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
-var levels = [l1g, l1g, l1a, l1b, l1c, l1d, l1e, l1f, l1g, l2, l3, l4, l5];
+var levels = [l1a, l3f, l1b, l1c, l1d, l1e, l1f, l1g, l2a, l2b, l2c, l2d, l2e, l2f, l2g, l3a, l4, l5];
var currentLevelID = 0;
-//var currentLevel = levels[currentLevelID].slice(0); //copy without reference, so we have original for retry/level reset.
+// Copy without reference, so we have original for retry/level reset.
var currentLevel = levels[currentLevelID].map(function (arr) {
return arr.slice();
});
var levelContainer = new Container();
@@ -812,9 +828,12 @@
// go to next level or game completed.
// If we haven't run out of levels, fo to the next one.
if (currentLevelID != levels.length - 1) {
currentLevelID++;
- currentLevel = levels[currentLevelID].slice(0);
+ //currentLevel = levels[currentLevelID].slice(0);
+ currentLevel = levels[currentLevelID].map(function (arr) {
+ return arr.slice();
+ });
console.log('new level is', currentLevel);
gridSize = currentLevel.length;
tileSize = calculateTileSize();
board.destroy();
A large calm background drawing for a puzzle game, in dark calm blueish colors and non-confusing content. High definition. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A quadratic polished dark blue marble slate. Front perspective with right angles. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A white question mark in a circle, like for a help button in a game.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A white X in a circle, like for a close window button in a game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A white questionmark on a black background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A green check mark on a dark background. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.