User prompt
Update the colors to still be a rainbow but with more saturation and more saturated
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: self.checkLines is not a function. (In 'self.checkLines()', 'self.checkLines' is undefined)' in this line: 'self.checkLines();' Line Number: 201
Code edit (10 edits merged)
Please save this source code
User prompt
Add board code that detects if a row or column has all cells filled
Code edit (1 edits merged)
Please save this source code
User prompt
After calling dragTarget.destroy, call self.createBlocks if blocks contain no blocks
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: dragTarget.destory is not a function. (In 'dragTarget.destory()', 'dragTarget.destory' is undefined)' in this line: 'dragTarget.destory();' Line Number: 188
Code edit (14 edits merged)
Please save this source code
User prompt
Add a colors array to block, which has 10 colors matching the full rainbow. Pastel colors
Code edit (2 edits merged)
Please save this source code
User prompt
Add a new cell class that can have two state, filled and not filled.
Code edit (1 edits merged)
Please save this source code
User prompt
Write the moveTowardsHomePosition method that moves the blocks toward their starting position
Code edit (4 edits merged)
Please save this source code
User prompt
Write the code in moveHome on block that animates the block back to it's starting position
Code edit (17 edits merged)
Please save this source code
User prompt
When you stop dragging a tile return it to it's start position
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
When creating cells in board make sure the cells are put into the right position in this.grid
User prompt
Fix Bug: 'ReferenceError: Can't find variable: startY' in this line: 'var cell = board.grid && board.grid[startY + i] && board.grid[startY + i][startX + j];' Line Number: 59
User prompt
rather than referring to self.parent.grid refer to board.grid
===================================================================
--- original.js
+++ change.js
@@ -39,8 +39,27 @@
}
}
self.startX = 0;
self.startY = 0;
+ self.moveHome = function () {
+ var dx = self.startX - self.x;
+ var dy = self.startY - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ var speed = 5;
+ var steps = distance / speed;
+ var stepX = dx / steps;
+ var stepY = dy / steps;
+ var step = 0;
+ var interval = LK.setInterval(function () {
+ if (step < steps) {
+ self.x += stepX;
+ self.y += stepY;
+ step++;
+ } else {
+ LK.clearInterval(interval);
+ }
+ }, 1000 / 60);
+ };
self.move = function (x, y) {
self.x = x;
self.y = y;
};
@@ -157,10 +176,10 @@
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
for (var a = blocks.length - 1; a >= 0; a--) {
- if (blocks[a]) {
- blocks[a].move();
+ if (blocks[a] && blocks[a] != dragTarget) {
+ blocks[a].moveHome();
}
}
board.checkLines();
});
White square with round corners, flat shaded, hyper casual game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
White square with tight round corners, flat shaded, hyper casual game. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Background for relaxing puzzle game. Pastel colors, flat shaded, vector art. Flowers. Blocks. Relaxing. Clouds Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
White particle cloud. Cartoon. Bright outline. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.