yimengjiutian/project/floors/MT154.js

67 lines
3.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

main.floors.MT154=
{
"floorId": "MT154",
"title": "主塔 154 层",
"name": "154",
"width": 13,
"height": 13,
"canFlyTo": false,
"canFlyFrom": false,
"canUseQuickShop": true,
"cannotViewMap": false,
"images": [
{
"name": "Sky.jpg",
"canvas": "bg",
"x": 0,
"y": 0
}
],
"ratio": 1,
"defaultGround": "ground",
"bgm": "heidian.mp3",
"firstArrive": [
{
"type": "setCurtain",
"time": 500
}
],
"eachArrive": [],
"parallelDo": "if (core.ui.getContextByName('bg1')) {\n\tvar lastTime = core.getFlag('lastWeatherTime1', 0);\n\t// 每多少毫秒重绘一次天气效果默认都是30\n\tif (timestamp - lastTime < 60) {\n\t\tcore.removeFlag('lastWeatherTime1');\n\t}\n\tif (timestamp - lastTime > 60) {\n\t\tcore.clearMap('bg1'); // 清空背景层\n\t\tvar lastOffsetY = core.getFlag('lastOffsetY', 0); // 上次的offset\n\t\tvar image = core.material.images.images[\"Sky.jpg\"]; // 获得图片,这里写图片名\n\t\tvar width = image.height,\n\t\t\theight = image.width; // 获得宽高\n\t\t// 绘制下一次参见drawImage的APIhttp://www.w3school.com.cn/tags/canvas_drawimage.asp\n\t\tif (lastOffsetY + 640 > height) { // 需要首尾相接\n\t\t\t// 尾部\n\t\t\tcore.ui.drawImage('bg1', image, lastOffsetY, 0, height - lastOffsetY, width, 0, 0, height - lastOffsetY, width);\n\t\t\t// 首部\n\t\t\tcore.ui.drawImage('bg1', image, 0, 0, lastOffsetY + 640 - height, width, height - lastOffsetY, 0, lastOffsetY + 640 - height, width);\n\t\t} else { // 不需要,直接绘制\n\t\t\tcore.ui.drawImage('bg1', image, lastOffsetY, 0, 640, width, 0, 0, 640, width);\n\t\t}\n\t\t// 移动图片\n\t\tlastOffsetY += 1; // 这里是每次移动的像素\n\t\tif (lastOffsetY > height) lastOffsetY -= height;\n\t\tcore.setFlag('lastOffsetY', lastOffsetY);\n\t\tcore.setFlag('lastWeatherTime1', timestamp); // 记录时间\n\t}\n} else {\n\tcore.createCanvas('bg1', 0, 0, 640, 640, 11)\n}",
"events": {},
"changeFloor": {},
"beforeBattle": {},
"afterBattle": {},
"afterGetItem": {},
"afterOpenDoor": {},
"autoEvent": {},
"cannotMove": {},
"cannotMoveIn": {},
"map": [
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
"bgmap": [
],
"fgmap": [
],
"bg2map": [
],
"fg2map": [
]
}