Code edit (7 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught ReferenceError: progressScreen is not defined' in or related to this line: 'if (progressScreen.alpha == 0) {' Line Number: 1130
User prompt
Please fix the bug: 'Uncaught ReferenceError: progressScreen is not defined' in or related to this line: 'if (progressScreen.alpha == 0) {' Line Number: 1130
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'includes')' in or related to this line: 'if (!storage.levelsDiscovered.includes(currentLevel.uid)) {' Line Number: 1054
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'includes')' in or related to this line: 'if (!storage.levelsDiscovered.includes(currentLevel.uid)) {' Line Number: 1054
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'includes')' in or related to this line: 'if (!storage.levelsDiscovered.includes(currentLevel.uid)) {' Line Number: 1054
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'includes')' in or related to this line: 'if (!storage.levelsDiscovered.includes(currentLevel.uid)) {' Line Number: 1054
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'includes')' in or related to this line: 'if (!storage.levelsDiscovered.includes(currentLevel.uid)) {' Line Number: 1054
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'includes')' in or related to this line: 'if (!storage.levelsDiscovered.includes(currentLevel.uid)) {' Line Number: 1054
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'includes')' in or related to this line: 'if (!storage.levelsDiscovered.includes(currentLevel.uid)) {' Line Number: 1054
Code edit (16 edits merged)
Please save this source code
User prompt
please implement the helpbutton blink method, so it makes the 12 blinkers appear and disappear 5 times in a blnking fashion
Code edit (1 edits merged)
Please save this source code
User prompt
in the helpbutton class, please place the 8 blinkers assets in a cicular pattern around the button.
Code edit (2 edits merged)
Please save this source code
User prompt
Please fix the bug: 'instructionsScreen.scale is not a function' in or related to this line: 'if (Math.random() < 0.12) {' Line Number: 429
User prompt
Please fix the bug: 'instructionsScreen.scale is not a function' in or related to this line: 'instructionsScreen.scale(1.2, 1.2);' Line Number: 1033
Code edit (14 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Unable to load plugin: @upit/tween.v1' in or related to this line: 'var tween = LK.import("@upit/tween.v1");' Line Number: 32 ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1, @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
User prompt
Please creata container class for the closebutton asset and add one to the helpscreen, in the top right corner
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- original.js
+++ change.js
@@ -94,11 +94,17 @@
var closeButtonGraphics = self.attachAsset('closeButton', {
anchorX: 0.5,
anchorY: 0.5
});
+ self.instructions = false, self.progress = false;
self.down = function () {
// Define what happens when the close button is pressed
- showInstructions();
+ if (self.instructions) {
+ showInstructions();
+ }
+ if (self.progress) {
+ showProgress();
+ }
};
});
var ColorBox = Container.expand(function (colorIndex) {
var self = Container.call(this);
@@ -358,8 +364,9 @@
});
var closeButton = new CloseButton();
closeButton.x = self.width / 2 - 75; // Position close button at the top right corner
closeButton.y = -self.height / 2 + 75;
+ closeButton.instructions = true;
self.addChild(closeButton);
var label = new Text2('HOW TO PLAY\n\n\n1. Tap a tile to remove all similar\n connected tiles\n\n2. New tiles will enter from the sides.\n\n3. Clear the board to complete the level.\n\n\nHint: Clear more blocks in one click\n for combo bonuses.', {
size: 60,
fill: 0xdddddd,
@@ -438,8 +445,41 @@
}
}
};
});
+var ProgressButton = Container.expand(function () {
+ var self = Container.call(this);
+ var arrowGraphics = self.attachAsset('progressButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.down = function () {
+ showProgress();
+ };
+});
+var ProgressScreen = Container.expand(function () {
+ var self = Container.call(this);
+ var arrowGraphics = self.attachAsset('levelCompleteBg', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0.87
+ });
+ var closeButton = new CloseButton();
+ closeButton.x = self.width / 2 - 75; // Position close button at the top right corner
+ closeButton.y = -self.height / 2 + 75;
+ closeButton.progress = true;
+ self.addChild(closeButton);
+ var label = new Text2("Levels Discovered: (x/42)", {
+ size: 60,
+ fill: 0xdddddd,
+ align: 'center',
+ font: 'Georgia'
+ });
+ label.anchor.set(0.5, 0.5);
+ label.x = 0;
+ label.y = -100;
+ self.addChild(label);
+});
var Star = Container.expand(function (startX, startY, endX, endY, delay, boxTint) {
var self = Container.call(this);
//GoldCoin.delayIncrement = 0;
//self.game = this;
@@ -673,8 +713,12 @@
helpButton.x = 2048 - 150;
helpButton.y = 2732 - 150;
game.addChild(helpButton);
helpButton.blink();
+var progressButton = new ProgressButton();
+progressButton.x = 150;
+progressButton.y = 2732 - 150;
+game.addChild(progressButton);
var levelLabel = new Text2('Level 1', {
size: 60,
//120,
fill: 0xFFFFFF,
@@ -1051,8 +1095,20 @@
instructionsScreen.x = 3000;
}
}
;
+function showProgress() {
+ if (progressScreen.alpha == 0) {
+ progressScreen.x = 1024;
+ progressScreen.y = boardCenterY;
+ progressScreen.alpha = 1;
+ game.addChild(progressScreen);
+ } else {
+ progressScreen.alpha = 0;
+ progressScreen.x = 3000;
+ }
+}
+;
function findConnectedSameColorTiles(startBox) {
var connectedTiles = [];
var visited = [];
var queue = [startBox];
@@ -1098,9 +1154,8 @@
var newY = y + dy;
// Check if the new position is within the grid boundaries
if (newX >= 0 && newX < currentLevel.d.length && newY >= 0 && newY < currentLevel.d[0].length) {
var colorBox = levelContainer.children.find(function (child) {
- //return child.gridX === newX && child.gridY === newY;
return !child.outlier && child.gridX === newX && child.gridY === newY;
});
if (colorBox) {
adjacentTiles.push(colorBox);
@@ -1109,15 +1164,13 @@
}
return adjacentTiles;
}
function colorBoxClicked(b) {
- console.log('colorbox clicked:', b);
- // Find connected tiles with same color
+ //console.log('colorbox clicked:', b);
var t = findConnectedSameColorTiles(b);
//console.log(t);
latestRemoveCount = t.length;
for (var i = 0; i < t.length; i++) {
- //t[i].destroy();
t[i].remove(i * 30);
}
}
function placeOutliers(delayBy) {
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.