From 06cb8cd64b35cf94a2359042948eaf8d39fea139 Mon Sep 17 00:00:00 2001 From: oc Date: Fri, 26 Oct 2018 19:50:23 +0800 Subject: [PATCH] moveImage speed --- libs/control.js | 2 +- libs/events.js | 9 +++++---- 更新说明.txt | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/control.js b/libs/control.js index c205e65c..f4cff9e7 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2412,7 +2412,7 @@ control.prototype.saveData = function() { var data = { 'floorId': core.status.floorId, - 'hero': core.clone(core.status.hero), + 'hero': hero, 'hard': core.status.hard, 'maps': core.maps.save(core.status.maps), 'route': core.encodeRoute(core.status.route), diff --git a/libs/events.js b/libs/events.js index b25f8c92..2ef77f0b 100644 --- a/libs/events.js +++ b/libs/events.js @@ -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]), toX = core.calValue(to[0]), toY = core.calValue(to[1]); var step = 0; + var per_time = 10, steps = parseInt(time / per_time); var drawImage = function () { core.clearMap('data'); - var nowX = parseInt(fromX + (toX-fromX)*step/64); - var nowY = parseInt(fromY + (toY-fromY)*step/64); + var nowX = parseInt(fromX + (toX-fromX)*step/steps); + var nowY = parseInt(fromY + (toY-fromY)*step/steps); 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 () { step++; drawImage(); - if (step>=64) { + if (step>=steps) { clearInterval(animate); core.clearMap('data'); core.status.replay.animate=false; if (keep) core.canvas.data.drawImage(image, toX, toY); if (core.isset(callback)) callback(); } - }, time / 64); + }, per_time); } ////// 淡入淡出音乐 ////// diff --git a/更新说明.txt b/更新说明.txt index d713bd0f..f15483f9 100644 --- a/更新说明.txt +++ b/更新说明.txt @@ -14,6 +14,7 @@ Autotile自动元件的新增和注册 可以设置剧情文本的字体大小 录像播放可以最高24倍速 1-6键快速设置录像播放速度;滚轮加减速 +进一步加强防作弊机制 部分其他细节优化 -----------------------------------------------------------------------