Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'la is not defined' in or related to this line: 'self.x -= self.parent.wind;' Line Number: 454
User prompt
Please fix the bug: 'la is not defined' in or related to this line: 'la.anchor.set(0.5, 0.5);' Line Number: 517
Code edit (11 edits merged)
Please save this source code
User prompt
Please fix the bug: 'i is not defined' in or related to this line: 'if (Math.random() < 0.12) {' Line Number: 470
User prompt
Please fix the bug: 'i is not defined' in or related to this line: 'var la = new Text2(levelsAll[i].name, {' Line Number: 511
User prompt
Please fix the bug: 'levelAll is not defined' in or related to this line: 'var la = new Text2(levelsAll[i].name, {' Line Number: 511
User prompt
Please fix the bug: 'levelAll is not defined' in or related to this line: 'var t = new ProgressMiniature(levelAll[i], true);' Line Number: 558
Code edit (3 edits merged)
Please save this source code
User prompt
please ensure the progressScreen paint method removes any preexisting instances of label, checkmarkand quesitonmark before it repaints them.
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
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
===================================================================
--- 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.