优化对称飞行器的用户体验

目的地会根据是否能飞显示绿/红框,再次按键或点击执行,从而使得使用飞时,不再需要仔细看位置
This commit is contained in:
YouWei Zhao 2017-12-23 13:06:53 +08:00
parent 2461373ae3
commit 67666f4f09
2 changed files with 6 additions and 2 deletions

View File

@ -445,7 +445,9 @@ core.prototype.keyDown = function(keyCode) {
core.status.usingCenterFly = false;
} else {
core.status.usingCenterFly = true;
core.fillRect('ui',(12-core.getHeroLoc('x'))*32,(12-core.getHeroLoc('y'))*32,32,32,'rgba(0,255,0,0.5)');
var fillstyle = 'rgba(255,0,0,0.5)';
if (core.canUseItem('centerFly')) fillstyle = 'rgba(0,255,0,0.5)';
core.fillRect('ui',(12-core.getHeroLoc('x'))*32,(12-core.getHeroLoc('y'))*32,32,32,fillstyle);
}
}
break;

View File

@ -459,7 +459,9 @@ events.prototype.useItem = function(itemId) {
}
if (itemId=='centerFly') {
core.status.usingCenterFly= true;
core.fillRect('ui',(12-core.getHeroLoc('x'))*32,(12-core.getHeroLoc('y'))*32,32,32,'rgba(0,255,0,0.5)');
var fillstyle = 'rgba(255,0,0,0.5)';
if (core.canUseItem('centerFly')) fillstyle = 'rgba(0,255,0,0.5)';
core.fillRect('ui',(12-core.getHeroLoc('x'))*32,(12-core.getHeroLoc('y'))*32,32,32,fillstyle);
return;
}