moveImage speed

This commit is contained in:
oc 2018-10-26 19:50:23 +08:00
parent 9b159f045d
commit 06cb8cd64b
3 changed files with 7 additions and 5 deletions

View File

@ -2412,7 +2412,7 @@ control.prototype.saveData = function() {
var data = { var data = {
'floorId': core.status.floorId, 'floorId': core.status.floorId,
'hero': core.clone(core.status.hero), 'hero': hero,
'hard': core.status.hard, 'hard': core.status.hard,
'maps': core.maps.save(core.status.maps), 'maps': core.maps.save(core.status.maps),
'route': core.encodeRoute(core.status.route), 'route': core.encodeRoute(core.status.route),

View File

@ -1425,10 +1425,11 @@ events.prototype.moveImage = function (image, from, to, time, keep, callback) {
var fromX = core.calValue(from[0]), fromY = core.calValue(from[1]), var fromX = core.calValue(from[0]), fromY = core.calValue(from[1]),
toX = core.calValue(to[0]), toY = core.calValue(to[1]); toX = core.calValue(to[0]), toY = core.calValue(to[1]);
var step = 0; var step = 0;
var per_time = 10, steps = parseInt(time / per_time);
var drawImage = function () { var drawImage = function () {
core.clearMap('data'); core.clearMap('data');
var nowX = parseInt(fromX + (toX-fromX)*step/64); var nowX = parseInt(fromX + (toX-fromX)*step/steps);
var nowY = parseInt(fromY + (toY-fromY)*step/64); var nowY = parseInt(fromY + (toY-fromY)*step/steps);
core.canvas.data.drawImage(image, nowX, nowY); core.canvas.data.drawImage(image, nowX, nowY);
} }
@ -1436,14 +1437,14 @@ events.prototype.moveImage = function (image, from, to, time, keep, callback) {
var animate = setInterval(function () { var animate = setInterval(function () {
step++; step++;
drawImage(); drawImage();
if (step>=64) { if (step>=steps) {
clearInterval(animate); clearInterval(animate);
core.clearMap('data'); core.clearMap('data');
core.status.replay.animate=false; core.status.replay.animate=false;
if (keep) core.canvas.data.drawImage(image, toX, toY); if (keep) core.canvas.data.drawImage(image, toX, toY);
if (core.isset(callback)) callback(); if (core.isset(callback)) callback();
} }
}, time / 64); }, per_time);
} }
////// 淡入淡出音乐 ////// ////// 淡入淡出音乐 //////

View File

@ -14,6 +14,7 @@ Autotile自动元件的新增和注册
可以设置剧情文本的字体大小 可以设置剧情文本的字体大小
录像播放可以最高24倍速 录像播放可以最高24倍速
1-6键快速设置录像播放速度滚轮加减速 1-6键快速设置录像播放速度滚轮加减速
进一步加强防作弊机制
部分其他细节优化 部分其他细节优化
----------------------------------------------------------------------- -----------------------------------------------------------------------