User prompt
in stage up, also remove the draggedTile from bottomTiles when destroying it
User prompt
in stage up, also add the cells who where added to grid container to the totest array
User prompt
add a toTest array to game
User prompt
in stage up, instead of removing cells attach them to the grid container
Code edit (5 edits merged)
Please save this source code
User prompt
in stage up, use the positions to attach the cells from draggedTile to the board at those positions.
User prompt
in stage up use the bg cell version of findCellColRow
User prompt
add a method like findCellColRow but for bgGrid
User prompt
in stage up, if overlappingCells.length is equal to draggedTile.cells.length, lookup the col and row position of the overlappingCells
User prompt
in stage up, if overlappingCells.length is equal to draggedTile.cells.length, lookup the col and row position of the overlappingCells
User prompt
in stage up identify the x and y position of overlappingCells by looking them up on the array
User prompt
in stage up, if overlappingCells.length is equal to draggedTile.cells.length, calculate the col and row position of the overlappingCells
User prompt
Fix Bug: 'ReferenceError: Can't find variable: raggedTile' in this line: 'self.addChild(raggedTile.cells);' Line Number: 310
Code edit (1 edits merged)
Please save this source code
User prompt
if overlappingCells length is equal to draggedTile.cells length in stage up, drop the cell to the board.
User prompt
On stage up, get the overlapping cells of draggedTile, and console log if the length of this array matches the length if the cells in the tile
User prompt
in highlightOverlappingCells, match the length of and tile.cells, if they don't match, return
User prompt
in highlightOverlappingCells, only highlight cells if overlappingCells is equal to the cells in tile
User prompt
in getOverlappingCells the return of empty array happens on the method inside forEach. However it's getOverlappingCells that should return an empty array
User prompt
in getOverlappingCells the if (grid[i][j]) { needs to break booth loops
User prompt
in getOverlappingCells the return of empty array happens on the method inside forEach. However it's getOverlappingCells that should return an empty array
User prompt
empty grid values are not null, just test for any nullable type in getOverlappingCells
Code edit (2 edits merged)
Please save this source code
User prompt
n getOverlappingCells, if an overlapping cell background does not have a corresponding empty grid, make getOverlappingCells return an empty array
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -306,12 +306,20 @@
self.resetBackgroundGridCells();
if (draggedTile) {
var overlappingCells = self.getOverlappingCells(draggedTile);
if (overlappingCells.length === draggedTile.cells.length) {
- var positions = overlappingCells.map(function (bgCell) {
- return self.findBgCellColRow(bgCell);
+ overlappingCells.forEach(function (bgCell, index) {
+ var colRow = self.findBgCellColRow(bgCell);
+ if (colRow && draggedTile.cells[index]) {
+ var cell = draggedTile.cells[index];
+ var targetPos = self.calculateTargetPosition(colRow.col, colRow.row);
+ cell.move(targetPos.x, targetPos.y, true);
+ grid[colRow.col][colRow.row] = cell;
+ draggedTile.removeChild(cell);
+ }
});
- console.log(positions);
+ draggedTile.destroy();
+ draggedTile = null;
}
}
draggedTile = null;
});
Simple White square round corners. Vector. No details. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Hour hand. Vector. Simple Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Simple Awesome background for clock chain reaction game. Vector high contrast.