From 0636c0ee3fb67d1f232a943625d6fab17aeb5976 Mon Sep 17 00:00:00 2001 From: lizhuoyuan <2820814112@qq.com> Date: Mon, 20 Jan 2025 20:19:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=BE=AE=E8=B0=83=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/actions.js | 2 +- libs/control.js | 6 +++--- libs/core.js | 2 +- libs/data.js | 2 +- libs/enemys.js | 2 +- libs/events.js | 2 +- libs/extensions.js | 2 +- libs/icons.js | 2 +- libs/items.js | 2 +- libs/loader.js | 2 +- libs/maps.js | 2 +- libs/ui.js | 2 +- libs/utils.js | 6 +++--- 13 files changed, 17 insertions(+), 17 deletions(-) diff --git a/libs/actions.js b/libs/actions.js index 25e73bea..856c2189 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -7,7 +7,7 @@ actions.js:用户交互的事件的处理 "use strict"; -function actions () { +function actions() { this._init(); this.SIZE = core.__SIZE__; this.HSIZE = core.__HALF_SIZE__; diff --git a/libs/control.js b/libs/control.js index e77c5409..b2e36303 100644 --- a/libs/control.js +++ b/libs/control.js @@ -8,7 +8,7 @@ control.js:游戏主要逻辑控制 "use strict"; -function control () { +function control() { this._init(); } @@ -1197,7 +1197,7 @@ control.prototype._checkBlock_repulse = function (repulse) { repulse.forEach(function (t) { actions.push({ "type": "move", "loc": [t[0], t[1]], "steps": [t[3]], "time": 100, "keep": true, "async": true }); }); - if (actions.length>0) actions.push({ "type": "waitAsync" }); + if (actions.length > 0) actions.push({ "type": "waitAsync" }); return actions; } @@ -1209,7 +1209,7 @@ control.prototype._checkBlock_ambush = function (ambush) { ambush.forEach(function (t) { actions.push({ "type": "move", "loc": [t[0], t[1]], "steps": [t[3]], "time": 100, "keep": false, "async": true }); }); - if (actions.length>0) actions.push({ "type": "waitAsync" }); + if (actions.length > 0) actions.push({ "type": "waitAsync" }); // 强制战斗 ambush.forEach(function (t) { actions.push({ diff --git a/libs/core.js b/libs/core.js index 58a9968d..80a27a40 100644 --- a/libs/core.js +++ b/libs/core.js @@ -6,7 +6,7 @@ "use strict"; -function core () { +function core() { this.__SIZE__ = 13; this.__PIXELS__ = this.__SIZE__ * 32; this.__HALF_SIZE__ = Math.floor(this.__SIZE__ / 2); diff --git a/libs/data.js b/libs/data.js index 89ffb694..5ec17f8c 100644 --- a/libs/data.js +++ b/libs/data.js @@ -2,7 +2,7 @@ "use strict"; -function data () { +function data() { this._init(); } diff --git a/libs/enemys.js b/libs/enemys.js index d162a05c..9de7695c 100644 --- a/libs/enemys.js +++ b/libs/enemys.js @@ -2,7 +2,7 @@ "use strict"; -function enemys () { +function enemys() { this._init(); } diff --git a/libs/events.js b/libs/events.js index 06fa8e6e..44908737 100644 --- a/libs/events.js +++ b/libs/events.js @@ -2,7 +2,7 @@ "use strict"; -function events () { +function events() { this._init(); } diff --git a/libs/extensions.js b/libs/extensions.js index 7f4b9fce..f3450523 100644 --- a/libs/extensions.js +++ b/libs/extensions.js @@ -6,7 +6,7 @@ extensions.js:负责拓展插件 "use strict"; -function extensions () { +function extensions() { } diff --git a/libs/icons.js b/libs/icons.js index 1f2d578a..7e0afb36 100644 --- a/libs/icons.js +++ b/libs/icons.js @@ -2,7 +2,7 @@ "use strict"; -function icons () { +function icons() { this._init(); } diff --git a/libs/items.js b/libs/items.js index d0f16760..a74f74b9 100644 --- a/libs/items.js +++ b/libs/items.js @@ -2,7 +2,7 @@ "use strict"; -function items () { +function items() { this._init(); } diff --git a/libs/loader.js b/libs/loader.js index 69a4373f..8d9e8cdd 100644 --- a/libs/loader.js +++ b/libs/loader.js @@ -6,7 +6,7 @@ loader.js:负责对资源的加载 */ "use strict"; -function loader () { +function loader() { this._init(); } diff --git a/libs/maps.js b/libs/maps.js index aa2c7c7d..6dccbb88 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -2,7 +2,7 @@ "use strict"; -function maps () { +function maps() { this._init(); } diff --git a/libs/ui.js b/libs/ui.js index 2a4a9a40..6bd62888 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -8,7 +8,7 @@ "use strict"; -function ui () { +function ui() { this._init(); // for convenience this.SIZE = core.__SIZE__; diff --git a/libs/utils.js b/libs/utils.js index a2bc9d06..5ac7ca35 100644 --- a/libs/utils.js +++ b/libs/utils.js @@ -7,7 +7,7 @@ utils.js 工具类 "use strict"; -function utils () { +function utils() { this._init(); this.scan = { 'up': { 'x': 0, 'y': -1 }, @@ -1351,7 +1351,7 @@ utils.prototype.http = function (type, url, formData, success, error, mimeType, // LZW-compress // https://gist.github.com/revolunet/843889 -function lzw_encode (s) { +function lzw_encode(s) { var dict = {}; var data = (s + "").split(""); var out = []; @@ -1378,7 +1378,7 @@ function lzw_encode (s) { } // Decompress an LZW-encoded string -function lzw_decode (s) { +function lzw_decode(s) { var dict = {}; var data = (s + "").split(""); var currChar = data[0];