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
User prompt
Please fix the bug: 'Set is not a constructor' in or related to this line: 'return n;' Line Number: 176
User prompt
Please fix the bug: 'Set is not a constructor' in or related to this line: 'return n;' Line Number: 176
User prompt
Please fix the bug: 'Set is not a constructor' in or related to this line: 'return n;' Line Number: 176
User prompt
Please fix the bug: 'Set is not a constructor' in or related to this line: 'return n;' Line Number: 176
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: cosole is not defined' in or related to this line: 'cosole.log('levelContainer:', levelContainer);' Line Number: 126
Code edit (1 edits merged)
Please save this source code
Code edit (19 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: tween is not defined' in or related to this line: 'tween(self, {' Line Number: 110 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Arrow is not defined' in or related to this line: 'var arrow = new Arrow();' Line Number: 40
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: visited.has is not a function' in or related to this line: '_iterator.f();' Line Number: 268
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: neighbours is not defined' in or related to this line: 'console.log(neighbours);' Line Number: 254
===================================================================
--- original.js
+++ change.js
@@ -114,11 +114,12 @@
duration: 300,
delay: delay,
easing: tween.easeInOut,
onFinish: function onFinish() {
- console.log("Animation complete!");
+ //console.log("Animation complete!");
//console.log('currentLevel:', currentLevel);
console.log('levelContainer:', levelContainer);
+ playerScore++;
self.destroy();
}
});
//self.destroy();
@@ -134,8 +135,40 @@
/****
* Game Code
****/
+function _toConsumableArray(r) {
+ return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray2(r) || _nonIterableSpread();
+}
+function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+}
+function _unsupportedIterableToArray2(r, a) {
+ if (r) {
+ if ("string" == typeof r) {
+ return _arrayLikeToArray2(r, a);
+ }
+ var t = {}.toString.call(r).slice(8, -1);
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray2(r, a) : void 0;
+ }
+}
+function _iterableToArray(r) {
+ if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) {
+ return Array.from(r);
+ }
+}
+function _arrayWithoutHoles(r) {
+ if (Array.isArray(r)) {
+ return _arrayLikeToArray2(r);
+ }
+}
+function _arrayLikeToArray2(r, a) {
+ (null == a || a > r.length) && (a = r.length);
+ for (var e = 0, n = Array(a); e < a; e++) {
+ n[e] = r[e];
+ }
+ return n;
+}
function _slicedToArray(r, e) {
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
}
function _nonIterableRest() {
@@ -248,8 +281,9 @@
n[e] = r[e];
}
return n;
}
+var playerScore = 0;
var colors = ['0x000000', '0xffffff', '0xffff00'];
var gridSize = 5;
var spacingRatio = 0.2;
var boardSize = 1300;
@@ -266,9 +300,10 @@
board.y = 2732 / 2;
game.addChild(board);
var l1 = [[0, 0, 0, 0, 0], [0, 1, 1, 1, 0], [0, 1, 2, 1, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0]];
var l2 = [[0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 0, 0], [0, 0, 2, 2, 0, 0], [0, 0, 1, 1, 0, 0], [0, 0, 2, 2, 0, 0], [0, 0, 0, 0, 0, 0]];
-var levels = [l1, l2];
+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 levels = [l1, l2, l3];
var currentLevel = levels[0].slice(0); //copy without reference, so we have original for retry/level reset.
var levelContainer = new Container();
levelContainer.x = 1024;
levelContainer.y = 2732 / 2;
@@ -358,10 +393,22 @@
function colorBoxClicked(b) {
console.log('colorbox clicked:', b);
// Find connected tiles with same color
var t = findConnectedSameColorTiles(b);
- console.log(t);
+ //console.log(t);
for (var i = 0; i < t.length; i++) {
//t[i].destroy();
- t[i].remove(i * 20);
+ t[i].remove(i * 30);
}
-}
\ No newline at end of file
+}
+function placeOutliers() {
+ var _ref;
+ var colorsPresent = Array.from(new Set((_ref = []).concat.apply(_ref, _toConsumableArray(currentLevel))));
+ console.log('colorsPresent:', colorsPresent);
+ // Determine what rows and cols contain colorboxes.
+ for (var i = 0; i < gridSize; i++) {}
+ // Determine amount of outliers to place
+ // Determine colors left on the board to choose from, and set outlier colors
+ // And place them. (Animate them in from sides.)
+}
+function moveIn() {}
+placeOutliers();
\ No newline at end of file
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.