User prompt
in tile.on('down' return if mergeMode is true
User prompt
in if (connectedNeighbors.length >= 3) { instead of calling mergeConnectedNeighbors push connectedNeighbors to toMove and set mergeMode to true
User prompt
Update if (!isAnyRowMoving) { to also not execute if mergeMode is true
User prompt
add a new array called toMerge to game
User prompt
in mergeConnectedNeighbors use self not this
User prompt
remove connectedNeighbors as an parameter on mergeConnectedNeighbors
User prompt
in mergeConnectedNeighbors define connectedNeighbors as var connectedNeighbors = self.findConnectedNeighbors(cell);
User prompt
make sure to call mergeConnectedNeighbors not handle connected neighbours
User prompt
rename handleConnectedNeighbors to merge mergeConnectedNeighbors
User prompt
change Game.prototype.handleConnectedNeighbors to self.handleConnectedNeighbors
User prompt
at the top of handleConnectedNeighbors define var colRow = self.findCellColRow(cell);
User prompt
Fix Bug: 'ReferenceError: Can't find variable: colRow' in this line: 'if (colRow) {' Line Number: 165
User prompt
Fix Bug: 'TypeError: this.findCellColRow is not a function. (In 'this.findCellColRow(neighborCell)', 'this.findCellColRow' is undefined)' in this line: 'var neighborColRow = this.findCellColRow(neighborCell);' Line Number: 155
User prompt
Move the code inside the if (connectedNeighbors.length >= 3) { statement to a separate method on game
User prompt
in game set cellWidth to 320 and cellHeight to 320
User prompt
in game set cellWidth to 325 and cellHeight to 325
User prompt
Add a mode variable to game called mergeMode, initialize it to false
User prompt
move bgCellGraphics 5px to the left
User prompt
Move bgCellGraphics 5 px to the right and 5px down
User prompt
In setAlphaAndTint reset calls set alpha to .5
User prompt
Move bgCellGraphics 5 px to the right and 5px dowN
User prompt
Move bgCellGraphics 5 px to the right and 5px down
User prompt
Set grid background cell alpha to .5
User prompt
In cell, set s in h s v to .3
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -401,9 +401,9 @@
var cell = self.toTest.shift();
var colRow = self.findCellColRow(cell);
var connectedNeighbors = self.findConnectedNeighbors(cell);
if (connectedNeighbors.length >= 3) {
- self.handleConnectedNeighbors(cell, connectedNeighbors);
+ self.mergeConnectedNeighbors(cell, connectedNeighbors);
}
}
var isAnyTileMoving = bottomTiles.some(function (tile) {
return tile.isMoving;
Simple White square round corners. Vector. No details. 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.
Simple White square round corners. Vector. No details. Single Game Texture. In-Game asset. 2d. White background. High contrast. No shadows.
Simple black arrow pointing up. Mouse cursor like.