This commit is contained in:
parent
a8977a3b5a
commit
28d46ca390
|
@ -701,14 +701,15 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
if(_status.currentChessFocus){
|
||||
cancelAnimationFrame(_status.currentChessFocus);
|
||||
}
|
||||
var count=12;
|
||||
var ddx=Math.floor(dx/12);
|
||||
var ddy=Math.floor(dy/12);
|
||||
var count=lib.config.low_performance?6:12;
|
||||
var ddx=Math.floor(dx/count);
|
||||
var ddy=Math.floor(dy/count);
|
||||
if(dx||dy){
|
||||
_status.currentChessFocus=requestAnimationFrame(function(){
|
||||
var chessFocus=function(){
|
||||
if(count--){
|
||||
ui.chessContainer.scrollLeft+=ddx;
|
||||
ui.chessContainer.scrollTop+=ddy;
|
||||
_status.currentChessFocus=requestAnimationFrame(chessFocus);
|
||||
}
|
||||
else{
|
||||
ui.chessContainer.scrollLeft+=dx%12;
|
||||
|
@ -716,7 +717,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
cancelAnimationFrame(_status.currentChessFocus);
|
||||
delete _status.currentChessFocus;
|
||||
}
|
||||
});
|
||||
};
|
||||
_status.currentChessFocus=requestAnimationFrame(chessFocus);
|
||||
}
|
||||
},
|
||||
getXY:function(){
|
||||
|
|
|
@ -34,7 +34,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
|
|||
get.chessDistance=result.get.chessDistance;
|
||||
get.rawAttitude=result.get.rawAttitude;
|
||||
var toLoad=['addChessPlayer','addObstacle','removeObstacle','isChessNeighbour',
|
||||
'draw2','updateCanvas2','setChessInfo','modeSwapPlayer'];
|
||||
'draw2','updateCanvas2','setChessInfo','modeSwapPlayer','initChess'];
|
||||
for(var i=0;i<toLoad.length;i++){
|
||||
game[toLoad[i]]=result.game[toLoad[i]];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue