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
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
===================================================================
--- original.js
+++ change.js
@@ -116,9 +116,9 @@
scaleY: 0.5,
rotation: Math.PI,
alpha: 0
}, {
- duration: 300,
+ duration: BASE_TWEEN_SPEED,
delay: delay,
easing: tween.easeInOut,
onFinish: function onFinish() {
//console.log("Animation complete!");
@@ -136,9 +136,9 @@
self.alpha = 0;
tween(self, {
alpha: 1
}, {
- duration: 300,
+ duration: BASE_TWEEN_SPEED,
delay: 0,
easing: tween.easeInOut,
onFinish: function onFinish() {
numRunningTweens--;
@@ -150,9 +150,9 @@
numRunningTweens++;
tween(self, {
alpha: 0
}, {
- duration: 300,
+ duration: BASE_TWEEN_SPEED,
delay: 0,
easing: tween.easeInOut,
onFinish: function onFinish() {
numRunningTweens--;
@@ -173,9 +173,9 @@
tween(self, {
x: destX,
y: destY
}, {
- duration: 300,
+ duration: BASE_TWEEN_SPEED,
delay: 0,
easing: tween.easeInOut,
onFinish: function onFinish() {
numRunningTweens--;
@@ -310,13 +310,14 @@
n[e] = r[e];
}
return n;
}
+var BASE_TWEEN_SPEED = 200;
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; //0; // increment to allow outliers spawning on different side each turn.
var playerScore = 0;
-var colors = ['0x000000', '0xffffff', '0xffff00'];
+var colors = ['0x000000', '0xffffff', '0xffff00', '0xff0000', '0x000055', '0x00ff00', '0xff00ff'];
var gridSize = 5;
var spacingRatio = 0.2;
var boardSize = 1300;
function calculateTileSize() {
@@ -330,12 +331,19 @@
var board = new Board();
board.x = 1024;
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 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, 0, 0, 0], [0, 0, 1, 0, 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, 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 levels = [l1, l2, l3];
+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]];
+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 = [l1a, l1b, l1c, l1d, l1e, l1f, l2, l3, l4, l5];
var currentLevelID = 0;
var currentLevel = levels[currentLevelID].slice(0); //copy without reference, so we have original for retry/level reset.
var levelContainer = new Container();
levelContainer.x = 1024;
@@ -487,9 +495,10 @@
outlierDirectionCounter++; // increment, so we get a new direction next turn.
if (currentDirection == 1 || currentDirection == 3) {
for (var i = 0; i < availableRows.length; i++) {
//if (Math.random() < 0.5 || !placedAtLeastOne) {
- if (true || !placedAtLeastOne) {
+ //if (true || !placedAtLeastOne) {
+ if (!placedAtLeastOne) {
// place it, either side will do.
var cIndex = colorsPresent[Math.floor(Math.random() * colorsPresent.length)];
var b = new ColorBox(cIndex);
b.outlier = true;
@@ -514,9 +523,10 @@
}
} else {
for (var i = 0; i < availableCols.length; i++) {
//if (Math.random() < 0.5 || !placedAtLeastOne) {
- if (true || !placedAtLeastOne) {
+ //if (true || !placedAtLeastOne) {
+ if (!placedAtLeastOne) {
// place it, either side will do
var cIndex = colorsPresent[Math.floor(Math.random() * colorsPresent.length)];
var b = new ColorBox(cIndex);
b.outlier = true;
@@ -542,9 +552,8 @@
}
}
}
// And place them. (Animate them in from sides.)
- //console.log(tween);
return true;
}
function shuffleArray(arr) {
var j, x, index;
@@ -707,14 +716,5 @@
} else {
//TODO: Show game over - all levels completed!
}
}
- /*
- if (LK.ticks % 12 == 0) {
- //console.log(numRunningTweens);
- if (numRunningTweens > 0) {
- GAME_IS_CLICKABLE = false;
- } else {
- GAME_IS_CLICKABLE = true;
- }
- }*/
};
\ 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.