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
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
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
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting '5')' in or related to this line: 'currentLevel[self.gridY][self.gridX] = self.colorIndex;' Line Number: 189
Code edit (13 edits merged)
Please save this source code
User prompt
Please fix the bug: 'newPosition is not defined' in or related to this line: 'if (newPosition != 999) {' Line Number: 638
Code edit (1 edits merged)
Please save this source code
Code edit (12 edits merged)
Please save this source code
User prompt
Please fix the bug: 'levelContainer.children.findAll is not a function' in or related to this line: 'var outliers = levelContainer.children.findAll(function (child) {' Line Number: 548
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: 'boxspacing is not defined' in or related to this line: 'b.y = offset + startY + i * (boxSize + boxspacing); // determine this' Line Number: 448
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Please fix the bug: 'cBox is not defined' in or related to this line: 'cBox.width = cBox.height = tileSize;' Line Number: 428
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Set is not a constructor' in or related to this line: 'return n;' Line Number: 176
===================================================================
--- original.js
+++ change.js
@@ -145,8 +145,23 @@
console.log('faded in:', self);
}
});
};
+ self.fadeOut = function () {
+ numRunningTweens++;
+ tween(self, {
+ alpha: 0
+ }, {
+ duration: 300,
+ delay: 0,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ numRunningTweens--;
+ console.log('faded out:', self);
+ self.destroy();
+ }
+ });
+ };
self.moveInPosition = function () {
var startX = -boardSize / 2;
var startY = -boardSize / 2;
var boxSize = tileSize; //calculateTileSize();
@@ -164,8 +179,9 @@
easing: tween.easeInOut,
onFinish: function onFinish() {
numRunningTweens--;
currentLevel[self.gridY][self.gridX] = self.colorIndex;
+ self.outlier = false;
console.log('done moving into position');
}
});
};
@@ -296,9 +312,9 @@
return n;
}
var GAME_IS_CLICKABLE = true; // flag for when board is clickable and when not.
var numRunningTweens = 0; // input is blocked while tweens running, so increment this when a tween starts, nd decrement when tween ends.
-var outlierDirectionCounter = 0; // increment to allow outliers spawning on different side each turn.
+var outlierDirectionCounter = 0; //0; // increment to allow outliers spawning on different side each turn.
var playerScore = 0;
var colors = ['0x000000', '0xffffff', '0xffff00'];
var gridSize = 7;
var spacingRatio = 0.2;
@@ -567,28 +583,57 @@
console.log('there are ', outliers.length, 'outliers');
for (var i = 0; i < outliers.length; i++) {
var t = outliers[i];
//console.log(t);
- var newPos;
+ var newPos = 999;
// Determine direction the outlier is moving in, in order to determine position to tween to.
if (t.gridX == -1) {
- // do something
+ for (var j = gridSize - 1; j >= 0; j--) {
+ //console.log('j entry is', currentLevel[t.gridY][j]);
+ if (currentLevel[t.gridY][j] != 0) {
+ newPos = j - 1;
+ }
+ }
+ //console.log(t, 'would move to position', newPos);
+ t.gridX = newPos;
+ //t.moveInPosition();
} else if (t.gridX == 99) {
- // do something
+ for (var j = 0; j < gridSize; j++) {
+ //console.log('j entry is', currentLevel[t.gridY][j]);
+ if (currentLevel[t.gridY][j] != 0) {
+ newPos = j + 1;
+ }
+ }
+ //console.log(t, 'would move to position', newPos);
+ t.gridX = newPos;
+ //t.moveInPosition();
} else if (t.gridY == -1) {
- newPos = gridSize;
for (var j = gridSize - 1; j >= 0; j--) {
- console.log('j entry is', currentLevel[j][t.gridX]);
+ //console.log('j entry is', currentLevel[j][t.gridX]);
if (currentLevel[j][t.gridX] != 0) {
newPos = j - 1;
}
}
- console.log(t, 'would move to position', newPos);
+ //console.log(t, 'would move to position', newPos);
t.gridY = newPos;
- t.moveInPosition();
+ //t.moveInPosition();
} else if (t.gridY == 99) {
- // do something
+ // do something, fix this
+ for (var j = 0; j < gridSize; j++) {
+ //console.log('j entry is', currentLevel[j][t.gridX]);
+ if (currentLevel[j][t.gridX] != 0) {
+ newPos = j + 1;
+ }
+ }
+ t.gridY = newPos;
+ //t.moveInPosition();
}
+ console.log(t, 'would move to position', newPos);
+ if (newPos != 999) {
+ t.moveInPosition();
+ } else {
+ t.fadeOut();
+ }
}
// Once in place, add them to currentLevel object. (or delete if flown ofscreen)
}
moveIn();
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.