您的位置:首页 > Web前端 > JavaScript

web小游戏 2048制作(四):过场动画 showanimation2048.js

2016-02-26 19:49 736 查看
function showNumberAnimation( i , j , randNumber ){

var numberCell = $('#number-cell-' + i + "-" + j );

numberCell.css('background-color',getBackGroundColor( randNumber ) );
numberCell.css('color',getNumberColor( randNumber ) );
numberCell.text( randNumber );

numberCell.animate({
width:'100px',
height:'100px',
top:getPosTop( i , j ),
left:getPosLeft( i , j )
},50);
}
function showMoveAnimation( fromx , fromy , tox, toy ){

var numberCell = $('#number-cell-' + fromx + '-' + fromy );
numberCell.animate({
top:getPosTop( tox , toy ),
left:getPosLeft( tox , toy )
},200);
}
function updateScore(score)
{
$('#score').text(score);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: