Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- grid[row][col] = $('<div>')
- .css({
- top : row * 100 + 'px',
- left : col * 100 + 'px'
- })
- .text(number)
- .addClass('box')
- .appendTo($('#grid'));
- function merge(row1, col1, row2, col2) {
- grid[row2][col2].remove();
- grid[row2][col2] = grid[row1][col1];
- grid[row1][col1] = null;
- var number = grid[row2][col2].text() * 2 ;
- grid[row2][col2]
- .css({
- top : row2 * 100 + 'px',
- left : col2 * 100 + 'px'
- })
- .text(number);
- return true;
- }
- grid[row2][col2].text(number);
- grid[row2][col2].animate({
- top : row2 * 100 + 'px',
- left : col2 * 100 + 'px'
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement