diff --git a/index.html b/index.html
index 40d87b6..2ffec0e 100644
--- a/index.html
+++ b/index.html
@@ -64,6 +64,7 @@
START GAME
LOAD GAME
+ CG MODE
REPLAY MODE
diff --git a/main.js b/main.js
index 167aaf1..d331ff9 100644
--- a/main.js
+++ b/main.js
@@ -48,6 +48,7 @@ function main() {
startButtons: document.getElementById('startButtons'),
playGame: document.getElementById('playGame'),
loadGame: document.getElementById('loadGame'),
+ CGMode: document.getElementById('CGMode'),
replayGame: document.getElementById('replayGame'),
levelChooseButtons: document.getElementById('levelChooseButtons'),
data: document.getElementById('data'),
diff --git a/project/bgms/Asphodelus_Ceui.mp3 b/project/bgms/Asphodelus_Ceui.mp3
new file mode 100644
index 0000000..718744a
Binary files /dev/null and b/project/bgms/Asphodelus_Ceui.mp3 differ
diff --git a/project/bgms/bgm.mp3 b/project/bgms/bgm.mp3
deleted file mode 100644
index 199d0bb..0000000
Binary files a/project/bgms/bgm.mp3 and /dev/null differ
diff --git a/project/bgms/theme.mp3 b/project/bgms/theme.mp3
new file mode 100644
index 0000000..efb307d
Binary files /dev/null and b/project/bgms/theme.mp3 differ
diff --git a/project/data.js b/project/data.js
index f4de01c..99b70ed 100644
--- a/project/data.js
+++ b/project/data.js
@@ -43,6 +43,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"now.png",
"null.png",
"r.png",
+ "shengnvxizao.png",
"status.png",
"statusBackground.jpg",
"statusBackground.png",
@@ -67,6 +68,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
],
"tilesets": [
"magictower.png",
+<<<<<<< HEAD
"5.png",
"4.png",
"3.png",
@@ -75,6 +77,13 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"11.png",
"6.png",
"12.png"
+=======
+ "Outside_B.png",
+ "C4.png",
+ "C3.png",
+ "C2.png",
+ "C1.png"
+>>>>>>> c231be42bfd5ed9860a83961156fbd923e2a2434
],
"animates": [
"hand",
diff --git a/project/icons.js b/project/icons.js
index 821cd29..40d0160 100644
--- a/project/icons.js
+++ b/project/icons.js
@@ -280,8 +280,12 @@ var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
"autotile2": 0,
"autotile3": 0,
"autotile4": 0,
+<<<<<<< HEAD
"autotile8": 0,
"autotile9": 0,
"autotile10": 0
+=======
+ "autotile5": 0
+>>>>>>> c231be42bfd5ed9860a83961156fbd923e2a2434
}
}
\ No newline at end of file
diff --git a/project/images/hero.png b/project/images/hero.png
index d81650a..f0c8d67 100644
Binary files a/project/images/hero.png and b/project/images/hero.png differ
diff --git a/project/maps.js b/project/maps.js
index 6a7f3de..243808a 100644
--- a/project/maps.js
+++ b/project/maps.js
@@ -106,9 +106,13 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
"137": {"cls":"npcs","id":"greenMan"},
"138": {"cls":"npcs","id":"blueTrader"},
"140": {"cls":"autotile","id":"autotile4"},
+<<<<<<< HEAD
"141": {"cls":"autotile","id":"autotile8"},
"142": {"cls":"autotile","id":"autotile9"},
"143": {"cls":"autotile","id":"autotile10"},
+=======
+ "141": {"cls":"autotile","id":"autotile5"},
+>>>>>>> c231be42bfd5ed9860a83961156fbd923e2a2434
"151": {"cls":"autotile","id":"autotile1"},
"152": {"cls":"autotile","id":"autotile2"},
"153": {"cls":"autotile","id":"autotile3"},
diff --git a/project/plugins.js b/project/plugins.js
index 8585562..fd79c15 100644
--- a/project/plugins.js
+++ b/project/plugins.js
@@ -350,159 +350,159 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}
},
"fiveLayers": function () {
- // 是否启用五图层(增加背景2层和前景2层) 将__enable置为true即会启用;启用后请保存后刷新编辑器
- // 背景层2将会覆盖背景层 被事件层覆盖 前景层2将会覆盖前景层
- // 另外 请注意加入两个新图层 会让大地图的性能降低一些
- // 插件作者:ad
- var __enable = false;
- if (!__enable) return;
+ // 是否启用五图层(增加背景2层和前景2层) 将__enable置为true即会启用;启用后请保存后刷新编辑器
+ // 背景层2将会覆盖背景层 被事件层覆盖 前景层2将会覆盖前景层
+ // 另外 请注意加入两个新图层 会让大地图的性能降低一些
+ // 插件作者:ad
+ var __enable = true;
+ if (!__enable) return;
- // 创建新图层
- function createCanvas (name, zIndex) {
- if (!name) return;
- var canvas = document.createElement('canvas');
- canvas.id = name;
- canvas.className = 'gameCanvas anti-aliasing';
- // 编辑器模式下设置zIndex会导致加入的图层覆盖优先级过高
- if (main.mode != "editor") canvas.style.zIndex = zIndex || 0;
- // 将图层插入进游戏内容
- document.getElementById('gameDraw').appendChild(canvas);
- var ctx = canvas.getContext('2d');
- core.canvas[name] = ctx;
- canvas.width = core._PX_ || core.__PIXELS__;
- canvas.height = core._PY_ || core.__PIXELS__;
- return canvas;
- }
+ // 创建新图层
+ function createCanvas(name, zIndex) {
+ if (!name) return;
+ var canvas = document.createElement('canvas');
+ canvas.id = name;
+ canvas.className = 'gameCanvas anti-aliasing';
+ // 编辑器模式下设置zIndex会导致加入的图层覆盖优先级过高
+ if (main.mode != "editor") canvas.style.zIndex = zIndex || 0;
+ // 将图层插入进游戏内容
+ document.getElementById('gameDraw').appendChild(canvas);
+ var ctx = canvas.getContext('2d');
+ core.canvas[name] = ctx;
+ canvas.width = core._PX_ || core.__PIXELS__;
+ canvas.height = core._PY_ || core.__PIXELS__;
+ return canvas;
+ }
- var bg2Canvas = createCanvas('bg2', 20);
- var fg2Canvas = createCanvas('fg2', 63);
- // 大地图适配
- core.bigmap.canvas = ["bg2", "fg2", "bg", "event", "event2", "fg", "damage"];
- core.initStatus.bg2maps = {};
- core.initStatus.fg2maps = {};
+ var bg2Canvas = createCanvas('bg2', 20);
+ var fg2Canvas = createCanvas('fg2', 63);
+ // 大地图适配
+ core.bigmap.canvas = ["bg2", "fg2", "bg", "event", "event2", "fg", "damage"];
+ core.initStatus.bg2maps = {};
+ core.initStatus.fg2maps = {};
- if (main.mode == 'editor') {
- /*插入编辑器的图层 不做此步新增图层无法在编辑器显示*/
- // 编辑器图层覆盖优先级 eui > efg > fg(前景层) > event2(48*32图块的事件层) > event(事件层) > bg(背景层)
- // 背景层2(bg2) 插入事件层(event)之前(即bg与event之间)
- document.getElementById('mapEdit').insertBefore(bg2Canvas, document.getElementById('event'));
- // 前景层2(fg2) 插入编辑器前景(efg)之前(即fg之后)
- document.getElementById('mapEdit').insertBefore(fg2Canvas, document.getElementById('ebm'));
- // 原本有三个图层 从4开始添加
- var num = 4;
- // 新增图层存入editor.dom中
- editor.dom.bg2c = core.canvas.bg2.canvas;
- editor.dom.bg2Ctx = core.canvas.bg2;
- editor.dom.fg2c = core.canvas.fg2.canvas;
- editor.dom.fg2Ctx = core.canvas.fg2;
- editor.dom.maps.push('bg2map', 'fg2map');
- editor.dom.canvas.push('bg2', 'fg2');
+ if (main.mode == 'editor') {
+ /*插入编辑器的图层 不做此步新增图层无法在编辑器显示*/
+ // 编辑器图层覆盖优先级 eui > efg > fg(前景层) > event2(48*32图块的事件层) > event(事件层) > bg(背景层)
+ // 背景层2(bg2) 插入事件层(event)之前(即bg与event之间)
+ document.getElementById('mapEdit').insertBefore(bg2Canvas, document.getElementById('event'));
+ // 前景层2(fg2) 插入编辑器前景(efg)之前(即fg之后)
+ document.getElementById('mapEdit').insertBefore(fg2Canvas, document.getElementById('ebm'));
+ // 原本有三个图层 从4开始添加
+ var num = 4;
+ // 新增图层存入editor.dom中
+ editor.dom.bg2c = core.canvas.bg2.canvas;
+ editor.dom.bg2Ctx = core.canvas.bg2;
+ editor.dom.fg2c = core.canvas.fg2.canvas;
+ editor.dom.fg2Ctx = core.canvas.fg2;
+ editor.dom.maps.push('bg2map', 'fg2map');
+ editor.dom.canvas.push('bg2', 'fg2');
- // 创建编辑器上的按钮
- var createCanvasBtn = function (name) {
- // 电脑端创建按钮
- var input = document.createElement('input');
- // layerMod4/layerMod5
- var id = 'layerMod' + num++;
- // bg2map/fg2map
- var value = name + 'map';
- input.type = 'radio';
- input.name = 'layerMod';
- input.id = id;
- input.value = value;
- editor.dom[id] = input;
- input.onchange = function () {
- editor.uifunctions.setLayerMod(value);
- }
- return input;
- };
-
- var createCanvasBtn_mobile = function (name) {
- // 手机端往选择列表中添加子选项
- var input = document.createElement('option');
- var id = 'layerMod' + num++;
- var value = name + 'map';
- input.name = 'layerMod';
- input.value = value;
- editor.dom[id] = input;
- return input;
- };
- if (!editor.isMobile) {
- var input = createCanvasBtn('bg2');
- var input2 = createCanvasBtn('fg2');
- // 获取事件层及其父节点
- var child = document.getElementById('layerMod'),
- parent = child.parentNode;
- // 背景层2插入事件层前
- parent.insertBefore(input, child);
- // 不能直接更改背景层2的innerText 所以创建文本节点
- var txt = document.createTextNode('bg2');
- // 插入事件层前(即新插入的背景层2前)
- parent.insertBefore(txt, child);
- // 向最后插入前景层2(即插入前景层后)
- parent.appendChild(input2);
- var txt2 = document.createTextNode('fg2');
- parent.appendChild(txt2);
- parent.childNodes[2].replaceWith("bg");
- parent.childNodes[6].replaceWith("事件");
- parent.childNodes[8].replaceWith("fg");
- } else {
- var input = createCanvasBtn_mobile('bg2');
- var input2 = createCanvasBtn_mobile('fg2');
- // 手机端因为是选项 所以可以直接改innerText
- input.innerText = '背景层2';
- input2.innerText = '前景层2';
- var parent = document.getElementById('layerMod');
- parent.insertBefore(input, parent.children[1]);
- parent.appendChild(input2);
+ // 创建编辑器上的按钮
+ var createCanvasBtn = function (name) {
+ // 电脑端创建按钮
+ var input = document.createElement('input');
+ // layerMod4/layerMod5
+ var id = 'layerMod' + num++;
+ // bg2map/fg2map
+ var value = name + 'map';
+ input.type = 'radio';
+ input.name = 'layerMod';
+ input.id = id;
+ input.value = value;
+ editor.dom[id] = input;
+ input.onchange = function () {
+ editor.uifunctions.setLayerMod(value);
}
- }
+ return input;
+ };
- var _loadFloor_doNotCopy = core.maps._loadFloor_doNotCopy;
- core.maps._loadFloor_doNotCopy = function () {
- return ["bg2map", "fg2map"].concat(_loadFloor_doNotCopy());
+ var createCanvasBtn_mobile = function (name) {
+ // 手机端往选择列表中添加子选项
+ var input = document.createElement('option');
+ var id = 'layerMod' + num++;
+ var value = name + 'map';
+ input.name = 'layerMod';
+ input.value = value;
+ editor.dom[id] = input;
+ return input;
+ };
+ if (!editor.isMobile) {
+ var input = createCanvasBtn('bg2');
+ var input2 = createCanvasBtn('fg2');
+ // 获取事件层及其父节点
+ var child = document.getElementById('layerMod'),
+ parent = child.parentNode;
+ // 背景层2插入事件层前
+ parent.insertBefore(input, child);
+ // 不能直接更改背景层2的innerText 所以创建文本节点
+ var txt = document.createTextNode('bg2');
+ // 插入事件层前(即新插入的背景层2前)
+ parent.insertBefore(txt, child);
+ // 向最后插入前景层2(即插入前景层后)
+ parent.appendChild(input2);
+ var txt2 = document.createTextNode('fg2');
+ parent.appendChild(txt2);
+ parent.childNodes[2].replaceWith("bg");
+ parent.childNodes[6].replaceWith("事件");
+ parent.childNodes[8].replaceWith("fg");
+ } else {
+ var input = createCanvasBtn_mobile('bg2');
+ var input2 = createCanvasBtn_mobile('fg2');
+ // 手机端因为是选项 所以可以直接改innerText
+ input.innerText = '背景层2';
+ input2.innerText = '前景层2';
+ var parent = document.getElementById('layerMod');
+ parent.insertBefore(input, parent.children[1]);
+ parent.appendChild(input2);
}
- ////// 绘制背景和前景层 //////
- core.maps._drawBg_draw = function (floorId, toDrawCtx, cacheCtx, config) {
- config.ctx = cacheCtx;
- core.maps._drawBg_drawBackground(floorId, config);
- // ------ 调整这两行的顺序来控制是先绘制贴图还是先绘制背景图块;后绘制的覆盖先绘制的。
- core.maps._drawFloorImages(floorId, config.ctx, 'bg', null, null, config.onMap);
- core.maps._drawBgFgMap(floorId, 'bg', config);
- if (config.onMap) {
- core.drawImage(toDrawCtx, cacheCtx.canvas, core.bigmap.v2 ? -32 : 0, core.bigmap.v2 ? -32 : 0);
- core.clearMap('bg2');
- core.clearMap(cacheCtx);
- }
- core.maps._drawBgFgMap(floorId, 'bg2', config);
- if (config.onMap) core.drawImage('bg2', cacheCtx.canvas, core.bigmap.v2 ? -32 : 0, core.bigmap.v2 ? -32 : 0);
- config.ctx = toDrawCtx;
+ }
+
+ var _loadFloor_doNotCopy = core.maps._loadFloor_doNotCopy;
+ core.maps._loadFloor_doNotCopy = function () {
+ return ["bg2map", "fg2map"].concat(_loadFloor_doNotCopy());
+ }
+ ////// 绘制背景和前景层 //////
+ core.maps._drawBg_draw = function (floorId, toDrawCtx, cacheCtx, config) {
+ config.ctx = cacheCtx;
+ core.maps._drawBg_drawBackground(floorId, config);
+ // ------ 调整这两行的顺序来控制是先绘制贴图还是先绘制背景图块;后绘制的覆盖先绘制的。
+ core.maps._drawFloorImages(floorId, config.ctx, 'bg', null, null, config.onMap);
+ core.maps._drawBgFgMap(floorId, 'bg', config);
+ if (config.onMap) {
+ core.drawImage(toDrawCtx, cacheCtx.canvas, core.bigmap.v2 ? -32 : 0, core.bigmap.v2 ? -32 : 0);
+ core.clearMap('bg2');
+ core.clearMap(cacheCtx);
}
- core.maps._drawFg_draw = function (floorId, toDrawCtx, cacheCtx, config) {
- config.ctx = cacheCtx;
- // ------ 调整这两行的顺序来控制是先绘制贴图还是先绘制前景图块;后绘制的覆盖先绘制的。
- core.maps._drawFloorImages(floorId, config.ctx, 'fg', null, null, config.onMap);
- core.maps._drawBgFgMap(floorId, 'fg', config);
- if (config.onMap) {
- core.drawImage(toDrawCtx, cacheCtx.canvas, core.bigmap.v2 ? -32 : 0, core.bigmap.v2 ? -32 : 0);
- core.clearMap('fg2');
- core.clearMap(cacheCtx);
- }
- core.maps._drawBgFgMap(floorId, 'fg2', config);
- if (config.onMap) core.drawImage('fg2', cacheCtx.canvas, core.bigmap.v2 ? -32 : 0, core.bigmap.v2 ? -32 : 0);
- config.ctx = toDrawCtx;
+ core.maps._drawBgFgMap(floorId, 'bg2', config);
+ if (config.onMap) core.drawImage('bg2', cacheCtx.canvas, core.bigmap.v2 ? -32 : 0, core.bigmap.v2 ? -32 : 0);
+ config.ctx = toDrawCtx;
+ }
+ core.maps._drawFg_draw = function (floorId, toDrawCtx, cacheCtx, config) {
+ config.ctx = cacheCtx;
+ // ------ 调整这两行的顺序来控制是先绘制贴图还是先绘制前景图块;后绘制的覆盖先绘制的。
+ core.maps._drawFloorImages(floorId, config.ctx, 'fg', null, null, config.onMap);
+ core.maps._drawBgFgMap(floorId, 'fg', config);
+ if (config.onMap) {
+ core.drawImage(toDrawCtx, cacheCtx.canvas, core.bigmap.v2 ? -32 : 0, core.bigmap.v2 ? -32 : 0);
+ core.clearMap('fg2');
+ core.clearMap(cacheCtx);
}
- ////// 移动判定 //////
- core.maps._generateMovableArray_arrays = function (floorId) {
- return {
- bgArray: this.getBgMapArray(floorId),
- fgArray: this.getFgMapArray(floorId),
- eventArray: this.getMapArray(floorId),
- bg2Array: this._getBgFgMapArray('bg2', floorId),
- fg2Array: this._getBgFgMapArray('fg2', floorId)
- };
- }
- },
+ core.maps._drawBgFgMap(floorId, 'fg2', config);
+ if (config.onMap) core.drawImage('fg2', cacheCtx.canvas, core.bigmap.v2 ? -32 : 0, core.bigmap.v2 ? -32 : 0);
+ config.ctx = toDrawCtx;
+ }
+ ////// 移动判定 //////
+ core.maps._generateMovableArray_arrays = function (floorId) {
+ return {
+ bgArray: this.getBgMapArray(floorId),
+ fgArray: this.getFgMapArray(floorId),
+ eventArray: this.getMapArray(floorId),
+ bg2Array: this._getBgFgMapArray('bg2', floorId),
+ fg2Array: this._getBgFgMapArray('fg2', floorId)
+ };
+ }
+},
"itemShop": function () {
// 道具商店相关的插件
// 可在全塔属性-全局商店中使用「道具商店」事件块进行编辑(如果找不到可以在入口方块中找)
@@ -1939,6 +1939,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.dom.playGame.style.fontSize = font + "px"
core.dom.loadGame.style.fontSize = font + "px"
+ core.dom.CGMode.style.fontSize = font + "px"
core.dom.replayGame.style.fontSize = font + "px"
core.dom.startButtonGroup.style.padding = font * 0.3 + "px 25px"
}
@@ -1947,6 +1948,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
main.dom.outerBackground.style.height = obj.totalHeight + 'px';
main.dom.outerUI.style.width = obj.totalWidth + 'px';
main.dom.outerUI.style.height = obj.totalHeight + 'px';
+ main.dom.CGUI.style.width = obj.totalWidth + 'px';
+ main.dom.CGUI.style.height = obj.totalHeight + 'px';
const innerSize = (obj.canvasWidth * core.domStyle.scale) + "px";
for (let i = 0; i < core.dom.gameCanvas.length; ++i)
@@ -1972,6 +1975,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
canvas.style.left = parseFloat(canvas.getAttribute("_left")) * core.domStyle.scale + "px";
canvas.style.top = parseFloat(canvas.getAttribute("_top")) * core.domStyle.scale + "px";
}
+
// resize next
main.dom.next.style.width = main.dom.next.style.height = 5 * core.domStyle.scale + "px";
main.dom.next.style.borderBottomWidth = main.dom.next.style.borderRightWidth = 4 * core.domStyle.scale + "px";
@@ -2060,6 +2064,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (core.status.automaticRoute == null) core.status.automaticRoute = {};
core.updateStatusBar();
+ core.ui.CG.update()
+
}
class StatusBar {
@@ -8628,5 +8634,182 @@ core.plugin.animate = {
}
core.registerAction('onmousewheel', '_sys_onmousewheel', actions.prototype._sys_onmousewheel, 0);
+},
+ "CG回廊": function () {
+ // 在此增加新插件
+ const CGUI = document.createElement('canvas'); //CGui画布设置
+ CGUI.style.position = 'absolute';
+ CGUI.style.zIndex = 0;
+ CGUI.id = 'CGUI';
+ main.dom.gameGroup.insertAdjacentElement('afterend', CGUI)
+ CGUI.style.top = "50%"
+ CGUI.style.left = "50%"
+ CGUI.style.transform = "translate(-50%,-50%)"
+ const ctx = CGUI.getContext("2d");
+ main.dom.CGUI = CGUI;
+ CGUI.onclick = function (e) {
+ try {
+ e.preventDefault();
+ if (core.isPlaying()) return false;
+ const left = core.dom.gameGroup.offsetLeft;
+ const top = core.dom.gameGroup.offsetTop;
+ const px = Math.floor((e.clientX - left) / core.domStyle.scale),
+ py = Math.floor((e.clientY - top) / core.domStyle.scale);
+ core.ui.CG.onclick(px * 3, py * 3);
+ } catch (ee) {
+ main.log(ee);
+ }
+ }
+
+ function drawImage(name, image, x, y, w, h, x1, y1, w1, h1, angle, reverse) {
+ // 检测文件名以 :x, :y, :o 结尾,表示左右翻转,上下翻转和中心翻转
+
+ image = core.material.images.images[image];
+
+
+ var scale = {
+ 'x': [-1, 1],
+ 'y': [1, -1],
+ 'o': [-1, -1]
+ };
+
+ // 只能接受2, 4, 8个参数
+ if (x != null && y != null) {
+ if (w == null || h == null) {
+ // 两个参数变成四个参数
+ w = image.width;
+ h = image.height;
+ }
+ if (x1 != null && y1 != null && w1 != null && h1 != null) {
+ if (!reverse && !angle) {
+ name.drawImage(image, x, y, w, h, x1, y1, w1, h1);
+ } else {
+ name.save();
+ name.translate(x1 + w1 / 2, y1 + h1 / 2);
+ if (reverse) name.scale(scale[reverse][0], scale[reverse][1]);
+ if (angle) name.rotate(angle);
+ name.drawImage(image, x, y, w, h, -w1 / 2, -h1 / 2, w1, h1);
+ name.restore();
+ }
+ return;
+ }
+ if (!reverse && !angle) {
+ name.drawImage(image, x, y, w, h);
+ } else {
+ name.save();
+ name.translate(x + w / 2, y + h / 2);
+ if (reverse) name.scale(scale[reverse][0], scale[reverse][1]);
+ if (angle) name.rotate(angle);
+ name.drawImage(image, -w / 2, -h / 2, w, h);
+ name.restore();
+ }
+ return;
+ }
+ }
+
+ function drawWindow(background, ctx, x, y, w, h, direction, px, py) {
+ // 仿RM窗口皮肤 ↓
+
+ drawImage(ctx, background, 0, 0, 128, 128, x + 2, y + 2, w - 4, h - 4);
+ // 绘制边框
+ // 上方
+ drawImage(ctx, background, 128, 0, 16, 16, x, y, 16, 16);
+ for (var dx = 0; dx < w - 64; dx += 32) {
+ drawImage(ctx, background, 144, 0, 32, 16, x + dx + 16, y, 32, 16);
+ drawImage(ctx, background, 144, 48, 32, 16, x + dx + 16, y + h - 16, 32, 16);
+ }
+ drawImage(ctx, background, 144, 0, w - dx - 32, 16, x + dx + 16, y, w - dx - 32, 16);
+ drawImage(ctx, background, 144, 48, w - dx - 32, 16, x + dx + 16, y + h - 16, w - dx - 32, 16);
+ drawImage(ctx, background, 176, 0, 16, 16, x + w - 16, y, 16, 16);
+ // 左右
+ for (var dy = 0; dy < h - 64; dy += 32) {
+ drawImage(ctx, background, 128, 16, 16, 32, x, y + dy + 16, 16, 32);
+ drawImage(ctx, background, 176, 16, 16, 32, x + w - 16, y + dy + 16, 16, 32);
+ }
+ drawImage(ctx, background, 128, 16, 16, h - dy - 32, x, y + dy + 16, 16, h - dy - 32);
+ drawImage(ctx, background, 176, 16, 16, h - dy - 32, x + w - 16, y + dy + 16, 16, h - dy - 32);
+ // 下方
+ drawImage(ctx, background, 128, 48, 16, 16, x, y + h - 16, 16, 16);
+ drawImage(ctx, background, 176, 48, 16, 16, x + w - 16, y + h - 16, 16, 16);
+
+ // arrow
+ if (px != null && py != null) {
+ if (direction == 'up') {
+ drawImage(ctx, background, 128, 96, 32, 32, px, y + h - 3, 32, 32);
+ } else if (direction == 'down') {
+ drawImage(ctx, background, 160, 96, 32, 32, px, y - 29, 32, 32);
+ }
+ }
+ // 仿RM窗口皮肤 ↑
+ }
+ class CG {
+ constructor() {
+ //cg列表
+ this.UIMx = [ //空位用‘none’填充,当前ui至多4列6行
+ ["none", "none", 'none'],
+ ["none", "none", "none"],
+ ["none", "none", "none"],
+ ];
+ }
+
+ //更新
+ update() {
+ this.background()
+ this.drawUI()
+ }
+ background() {
+ if (core.domStyle.isVertical) {
+ ctx.canvas.width = 1248;
+ ctx.canvas.height = 2028;
+
+ core.setTextAlign(ctx, 'center');
+ } else {
+ ctx.canvas.width = 2028;
+ ctx.canvas.height = 1248;
+
+ core.setTextAlign(ctx, 'center');
+ }
+
+
+ }
+ onclick(px, py) { //点击
+ console.log([px, py])
+ if (px >= 33 && px <= 177 && py >= 33 && py <= 177) { //离开按钮是一致的,其余的记区分横竖屏
+ CGUI.style.zIndex = 0
+ core.clearMap(ctx)
+ core.restart();
+ }
+ }
+ drawUI() {
+ core.clearMap(CGUI)
+ if (!core?.material?.images?.images['winskin1.png']) return
+ if (core.domStyle.isVertical) { //竖屏
+
+ core.drawWindowSkin('winskin1.png', ctx, 0, 0, 1248, 2028)
+ core.setTextAlign(ctx, 'center');
+ core.fillRoundRect(ctx, 45 - 6, 45 - 6, 120 + 12, 120 + 12, 6, '#444444');
+ core.strokeRoundRect(ctx, 45 - 12, 45 - 12, 120 + 24, 120 + 24, 12, "#444444", 3)
+ core.fillText(ctx, '离开', 100, 110, '#FFFFFF', core.ui._buildFont(33, true))
+ } else { //横屏
+ ctx.canvas.width = 2028;
+ ctx.canvas.height = 1248;
+ core.drawWindowSkin('winskin1.png', ctx, 0, 0, 2028, 1248)
+ core.setTextAlign(ctx, 'center');
+ core.fillRoundRect(ctx, 45 - 6, 45 - 6, 120 + 12, 120 + 12, 6, '#444444');
+ core.strokeRoundRect(ctx, 45 - 12, 45 - 12, 120 + 24, 120 + 24, 12, "#444444", 3)
+ core.fillText(ctx, '离开', 100, 110, '#FFFFFF', core.ui._buildFont(33, true))
+ }
+
+
+ }
+
+ }
+ core.ui.CG = new CG();
+ main.dom.CGMode.onclick = function () {
+ main.core.control.checkBgm();
+
+ CGUI.style.zIndex = 10000
+ main.core.ui.CG.update()
+ }
}
}
\ No newline at end of file
diff --git a/project/tilesets/C1.png b/project/tilesets/C1.png
new file mode 100644
index 0000000..235762a
Binary files /dev/null and b/project/tilesets/C1.png differ
diff --git a/project/tilesets/C2.png b/project/tilesets/C2.png
new file mode 100644
index 0000000..0f5fa43
Binary files /dev/null and b/project/tilesets/C2.png differ
diff --git a/project/tilesets/C3.png b/project/tilesets/C3.png
new file mode 100644
index 0000000..6f9c042
Binary files /dev/null and b/project/tilesets/C3.png differ
diff --git a/project/tilesets/C4.png b/project/tilesets/C4.png
new file mode 100644
index 0000000..6b701b1
Binary files /dev/null and b/project/tilesets/C4.png differ
diff --git a/project/tilesets/Outside_B.png b/project/tilesets/Outside_B.png
new file mode 100644
index 0000000..c907136
Binary files /dev/null and b/project/tilesets/Outside_B.png differ