User prompt
change fliptile routine so that it just flips the clicked tile rather than using shape data. Still retain the red highlight before it flips to green
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: gridSize is not defined' in or related to this line: 'self.gridSize = gridSize;' Line Number: 181
User prompt
Fix Bug: 'Uncaught ReferenceError: gridSize is not defined' in or related to this line: 'self.color = gridX === gridSize - 1 && gridY === 0 ? 0x33d62a : 0xFFFFFF; // Set all cells to white apart from the cell Zbert is on in the bottom left corner, set this cell to green' Line Number: 181
User prompt
Fix Bug: 'Uncaught ReferenceError: i is not defined' in or related to this line: 'self.color = i === this.gridSize - 1 && j === 0 ? 0x33d62a : 0xFFFFFF; // Set all cells to white apart from the cell Zbert is on in the bottom left corner, set this cell to green' Line Number: 181
User prompt
When grid is initiated sett all cells to white apart from cell Zbert is on in bottom left corner. set this cell to green
Code edit (4 edits merged)
Please save this source code
User prompt
When grid is initiated set all tiles to white
Code edit (4 edits merged)
Please save this source code
User prompt
Attach asset Zbert1 to left hand bottom grid cell.
User prompt
Fix Bug: 'Uncaught ReferenceError: CountdownTimer is not defined' in or related to this line: 'var countdownTimer = game.addChild(new CountdownTimer());' Line Number: 296
User prompt
remove shapedisplay code
User prompt
Fix Bug: 'ReferenceError: shapeDisplayData is not defined' in or related to this line: 'var shapeData = shapeDisplayData;' Line Number: 39
User prompt
Fix Bug: 'Uncaught ReferenceError: ShapeDisplay is not defined' in or related to this line: 'game.shapeDisplay = new ShapeDisplay();' Line Number: 240
User prompt
Fix Bug: 'ReferenceError: shapeDisplay is not defined' in or related to this line: 'var shapeData = shapeDisplay.shape.shapeData;' Line Number: 39
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: CountdownTimer is not defined' in or related to this line: 'var countdownTimer = game.addChild(new CountdownTimer());' Line Number: 296
Code edit (7 edits merged)
Please save this source code
User prompt
Remove countdown timeand next shape text
User prompt
Fix Bug: 'Uncaught TypeError: self.attachAsset is not a function' in this line: 'var tileGraphics = self.attachAsset('tile', {});' Line Number: 263
User prompt
Fix Bug: 'Uncaught TypeError: self.attachAsset is not a function' in this line: 'var tileGraphics = self.attachAsset('tile', {});' Line Number: 262
User prompt
Fix Bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'flipColor')' in this line: 'tile.flipColor();' Line Number: 55
Code edit (5 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'color')' in this line: 'if (tileArray[i][j].color === 0xFFFFFF) {' Line Number: 68
===================================================================
--- original.js
+++ change.js
@@ -32,9 +32,9 @@
self.addChild(tile);
tileArray[i][j] = tile;
// Attach Zbert to the left hand bottom grid cell
if (i === this.gridSize - 1 && j === 0) {
- var zbert = new Zbert(tile.x, tile.y - 150, 150, 150);
+ var zbert = new Zbert(tile.x, tile.y - 130, 180, 180);
self.addChild(zbert);
}
// Update color counts
if (tile.color === 0xFFFFFF) {
@@ -50,35 +50,16 @@
}
};
// Function to flip the color of a tile and its neighbors
self.flipTiles = function (x, y) {
- // Get the current shape data from the ShapeDisplay
- var shapeData = shapeDisplay.shape.shapeData;
- // Loop through the shape data, highlight tiles that will flip in red, and flip them after a delay
- for (var i = 0; i < shapeData.length; i++) {
- for (var j = 0; j < shapeData[i].length; j++) {
- if (shapeData[i][j] === 1) {
- var targetX = x + i - 1;
- var targetY = y + j - 1;
- if (targetX >= 0 && targetX < this.gridSize && targetY >= 0 && targetY < this.gridSize) {
- // Highlight the tile in red
- var tileToFlip = tileArray[targetX][targetY];
- if (tileToFlip) {
- tileToFlip.highlight(0xff0000);
- }
- // Flip the tile color after a delay
- if (tileToFlip) {
- LK.setTimeout(function (tile) {
- return function () {
- if (tile) {
- tile.flipColor();
- }
- };
- }(tileToFlip), 700);
- }
- }
- }
- }
+ // Highlight the clicked tile in red
+ var tileToFlip = tileArray[x][y];
+ if (tileToFlip) {
+ tileToFlip.highlight(0xff0000);
+ // Flip the tile color after a delay
+ LK.setTimeout(function () {
+ tileToFlip.flipColor();
+ }, 700);
}
// Update color counts after a delay to ensure it happens after all tiles have flipped
LK.setTimeout(function () {
var whiteCount = 0;
beautiful landscape. starry sky, pastel colours, high definition, alien world. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
beautiful landscape. starry sky, pastel colours, high definition, alien world.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
beautiful expansive landscape. starry sky, pastel colours, high definition, alien world.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
beautiful expansive landscape. starry sky, pastel colours, high definition, alien world.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A little cube person. 2 legs. back to viewer. facing 45 degrees to the right. multicoloured skin, cartoon style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
white circle. metallic. light bevel on edge. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Round furry, cute alien ball with big eyes. vivid colours, looking at 45 degrees to the right. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
bright 3d present with bow, vivd colours. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Change to be vivid multicoloured cube
A simple Triangle, flat shaded, bevelled edges. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Speech bubble with expletive word in it. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
parachute. multicoloured. cartoon style.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
white circle with a single thin black border. flat shade. simple graphic. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
small star shape, vivid metallic blue, varying length spikes on star. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.