Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'levelNameLabel is not defined' in or related to this line: 'if (Math.random() < 0.12) {' Line Number: 403
User prompt
Please fix the bug: 'levelNameLabel is not defined' in or related to this line: 'levelNameLabel.setText(a.name, ' ', a.uid);' Line Number: 984
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading '0')' in or related to this line: 'var n = source[0].length;' Line Number: 1219
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'length')' in or related to this line: 'var m = source.length;' Line Number: 1218
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading '0')' in or related to this line: 'var gridSize = currentLevel.d.length;' Line Number: 1087
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading '0')' in or related to this line: 'for (var j = 0; j < a.d[0].length; j++) {' Line Number: 965
User prompt
Please fix the bug: 'levels[currentLevelID].map is not a function' in or related to this line: 'for (var i = 0; i < a.d.length; i++) {' Line Number: 964
User prompt
Please fix the bug: 'levels[currentLevelID].map is not a function' in or related to this line: 'var currentLevel = levels[currentLevelID].map(function (arr) {' Line Number: 935
Code edit (1 edits merged)
Please save this source code
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'tint')' in or related to this line: 'self.boxGraphics.tint = 0x222222;' Line Number: 152
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'tint')' in or related to this line: 'self.boxGraphics.tint = 0xffffff;' Line Number: 146
Code edit (1 edits merged)
Please save this source code
Code edit (21 edits merged)
Please save this source code
User prompt
Please fix the bug: 'instructions is not defined' in or related to this line: 'game.addChild(instructions);' Line Number: 761
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: particleGraphics.setScale is not a function' in or related to this line: 'particleGraphics.setScale(sc, sc);' Line Number: 314
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
please make the particles move upwards in a wavy pattern instead of straight like now. Use individual amplitude for particles so they don't all move exactly the same.
User prompt
Please fix the bug: 'ReferenceError: particleGraphicsGraphics is not defined' in or related to this line: 'self.addChild(particleGraphicsGraphics);' Line Number: 313
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'if (self.particles.length < self.particlesMax) {' Line Number: 329
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -904,11 +904,12 @@
//var levels = [l1a, l6g, l6b, l6c, l6d, l1b, l1c, l1d, l1e, l1f, l1g, l2a, l2b, l2c, l2d, l2e, l2f, l2g, l3a, l3b, l3c, l3d, l3e, l3f, l3g, l4a, l4b, l4c, l4d, l4e, l4f, l4g, l5a, l5b, l5c, l5d, l5e, l5f, l5g, l6a, l6b, l6c, l6d, l6e, l6f, l6g];
var levels = randomLevelSelection();
var currentLevelID = 0;
// Copy without reference, so we have original for retry/level reset.
-var currentLevel = levels[currentLevelID].d.map(function (arr) {
- return Array.isArray(arr) ? arr.slice() : [];
-});
+//var currentLevel = levels[currentLevelID].map(function (arr) {
+// return Array.isArray(arr) ? arr.slice() : [];
+//});
+var currentLevel = levels[currentLevelID];
var stars = [];
var latestRemoveCount = 0;
var levelContainer = new Container();
levelContainer.x = 1024;
@@ -933,30 +934,27 @@
var boxSize = tileSize;
var boxSpacing = boxSize * spacingRatio;
var offset = boxSize / 2 + boxSpacing;
var delayCounter = 0;
- for (var i = 0; i < a.length; i++) {
- if (a.d && a.d[0]) {
- // Check if a.d and a.d[0] are defined
- for (var j = 0; j < a.d[0].length; j++) {
- if (a.d[j][i] != 0) {
- var cBox = levelContainer.addChild(new ColorBox(a.d[j][i]));
- cBox.width = cBox.height = boxSize;
- //cBox.x = offset + startX + i * (boxSize + boxSpacing);
- //cBox.y = offset + startY + j * (boxSize + boxSpacing);
- cBox.gridX = i;
- cBox.gridY = j;
- var destX = offset + startX + i * (boxSize + boxSpacing);
- var destY = offset + startY + j * (boxSize + boxSpacing);
- var delayFactor = delayCounter;
- delayCounter += 60;
- //cBox.x = -1500;
- //cBox.y = destY;
- cBox.enterBoard(destX, destY, delayFactor);
- }
+ for (var i = 0; i < a.d.length; i++) {
+ for (var j = 0; j < a.d[0].length; j++) {
+ if (a.d[j][i] != 0) {
+ var cBox = levelContainer.addChild(new ColorBox(a.d[j][i]));
+ cBox.width = cBox.height = boxSize;
+ //cBox.x = offset + startX + i * (boxSize + boxSpacing);
+ //cBox.y = offset + startY + j * (boxSize + boxSpacing);
+ cBox.gridX = i;
+ cBox.gridY = j;
+ var destX = offset + startX + i * (boxSize + boxSpacing);
+ var destY = offset + startY + j * (boxSize + boxSpacing);
+ var delayFactor = delayCounter;
+ delayCounter += 60;
+ //cBox.x = -1500;
+ //cBox.y = destY;
+ cBox.enterBoard(destX, destY, delayFactor);
}
}
- } // Close the if block
+ }
return delayCounter;
}
var initDelay = paintLevel(currentLevel);
if (!storage.instructionsShown) {
@@ -1056,9 +1054,9 @@
}
function placeOutliers(delayBy) {
// Determine colors left on the board to choose from.
var colorsPresent = [];
- var gridSize = currentLevel && currentLevel.d ? currentLevel.d.length : 0;
+ var gridSize = currentLevel.d.length;
for (var i = 0; i < gridSize; i++) {
for (var j = 0; j < gridSize; j++) {
var t = currentLevel.d[i][j];
if (t != 0 && !colorsPresent.includes(t)) {
@@ -1187,10 +1185,10 @@
return i != 0;
}
function rotateMatrix90C(source) {
// get the dimensions of the source matrix
- var m = source ? source.length : 0;
- var n = source && source[0] ? source[0].length : 0;
+ var m = source.length;
+ var n = source[0].length;
// create a new NxM destination array
var destination = new Array(n);
for (var i = 0; i < n; i++) {
destination[i] = new Array(m);
@@ -1366,11 +1364,12 @@
//TODO: remove levelcomplete screen and stat next level.
levelCompleteScreen.destroy();
currentLevelID++;
//currentLevel = levels[currentLevelID].slice(0);
- currentLevel = levels[currentLevelID].map(function (arr) {
- return arr.slice();
- });
+ //currentLevel = levels[currentLevelID].map(function (arr) {
+ // return arr.slice();
+ //});
+ currentLevel = levels[currentLevelID];
console.log('new level is', currentLevel);
gridSize = currentLevel.d.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.