Merge pull request #6 from i2Echo/master

docs: use cdn & update readme
This commit is contained in:
Zhang Chen 2017-12-17 22:45:16 +08:00 committed by GitHub
commit 4f123711da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 61 additions and 44 deletions

View File

@ -3,7 +3,6 @@
## 简介 ## 简介
HTML5 canvas制作的魔塔样板支持全平台游戏 HTML5 canvas制作的魔塔样板支持全平台游戏
**即使完全不会编程的用户,按照模板和说明文档也能很快做出一个魔塔游戏!** **即使完全不会编程的用户,按照模板和说明文档也能很快做出一个魔塔游戏!**
* [Demo / 样板效果](http://ckcz123.com/games/template/) * [Demo / 样板效果](http://ckcz123.com/games/template/)
@ -13,25 +12,24 @@ HTML5 canvas制作的魔塔样板支持全平台游戏
## 更新说明 ## 更新说明
#### 2017.12.16 ### 2017.12.16
- [x] 新增:战斗过程显示,可以在设置中关闭 * [x] 新增:战斗过程显示,可以在设置中关闭
- [x] 新增勇士支持48*32大图的行走图 * [x] 新增勇士支持48*32大图的行走图
- [x] 新增:更改画面色调 * [x] 新增:更改画面色调
- [x] 新增:文字显示支持自动换行 * [x] 新增:文字显示支持自动换行
- [x] 部分修改状态栏UI * [x] 部分修改状态栏UI
- [x] 增添Web的Markdown文档移除原本的doc和pdf文档。 * [x] 增添Web的Markdown文档移除原本的doc和pdf文档。
- [x] 修复若干Bug。 * [x] 修复若干Bug。
#### 2017.12.9 ### 2017.12.9
- 发布初版HTML5魔塔样板
* 发布初版HTML5魔塔样板
## 联系我们 ## 联系我们
本塔由 `ckcz123` 百度ID `艾之葵`)编写,非常感谢 `iEcho` 在包括状态栏等方面的帮助 本塔由 [`ckcz123`](https://github.com/ckcz123) 百度ID `艾之葵`)编写
HTML5魔塔交流群群号 `539113091` HTML5魔塔交流群群号 `539113091`
如有其它意见或建议,也可以通过发issues、或邮件至<a href="mailto:ckcz123.com">ckcz123.com</a>联系我。 如有其它意见或建议,也可以通过发[issues](https://github.com/ckcz123/mota-js/issues)、或邮件至[ckcz123.com](mailto:ckcz123.com)联系我。

2
docs/docsify.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Description"> <meta name="description" content="Description">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="vue.css"> <link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>
@ -43,6 +43,6 @@
navigator.serviceWorker.register('serviceWorker.js') navigator.serviceWorker.register('serviceWorker.js')
} }
</script> </script>
<script src="docsify.min.js"></script> <script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

View File

@ -904,33 +904,54 @@ core.prototype.automaticRoute = function (destX, destY) {
if (deep!==nowDeep) {queue.push(f);continue;} if (deep!==nowDeep) {queue.push(f);continue;}
f=f%169; f=f%169;
var nowX = parseInt(f / 13), nowY = f % 13; var nowX = parseInt(f / 13), nowY = f % 13;
var nowIsArrow = false, nowId, nowBlock = core.getBlock(nowX,nowY);
if (nowBlock!=null){
nowId = nowBlock.block.event.id;
nowIsArrow = nowId.slice(0, 5).toLowerCase() == 'arrow';
}
for (var direction in scan) { for (var direction in scan) {
if(nowIsArrow){
var nowArrow = nowId.slice(5).toLowerCase();
if (direction != nowArrow) continue;
}
var nx = nowX + scan[direction].x; var nx = nowX + scan[direction].x;
var ny = nowY + scan[direction].y; var ny = nowY + scan[direction].y;
if (nx<0 || nx>12 || ny<0 || ny>12) continue; if (nx<0 || nx>12 || ny<0 || ny>12) continue;
var nid = 13 * nx + ny; var nid = 13 * nx + ny;
if (core.isset(route[nid])) continue; if (core.isset(route[nid])) continue;
var deepAdd=1;
var nextId, nextBlock = core.getBlock(nx,ny);
if (nextBlock!=null){
nextId = nextBlock.block.event.id;console.log(nextId);
// 遇到单向箭头处理
var isArrow = nextId.slice(0, 5).toLowerCase() == 'arrow';
if(isArrow){
var nextArrow = nextId.slice(5).toLowerCase();
if ( (scan[direction].x + scan[nextArrow].x) == 0 && (scan[direction].y + scan[nextArrow].y) == 0 ) continue;
}
// 绕过亮灯(因为只有一次通行机会很宝贵)
if(nextId == "light") deepAdd=50;
// 绕过路障
if (nextId.substring(nextId.length-3)=="Net") deepAdd=100;
// 绕过血瓶
if (!core.flags.potionWhileRouting && nextId.substring(nextId.length-6)=="Potion") deepAdd=20;
// 绕过可能的夹击点
if (nextBlock.block.event.trigger == 'checkBlock') deepAdd=200;
}
if (nx == destX && ny == destY) { if (nx == destX && ny == destY) {
route[nid] = direction; route[nid] = direction;
break; break;
} }
if (core.noPassExists(nx, ny)) if (core.noPassExists(nx, ny))
continue; continue;
var deepAdd=1;
var block = core.getBlock(nx,ny);
if (block!=null) {
var id = block.block.event.id;
// 绕过路障
if (id.substring(id.length-3)=="Net") deepAdd=100;
// 绕过血瓶
if (!core.flags.potionWhileRouting && id.substring(id.length-6)=="Potion") deepAdd=20;
// 绕过可能的夹击点
if (block.block.event.trigger == 'checkBlock') deepAdd=200;
}
route[nid] = direction; route[nid] = direction;
queue.push(169*(nowDeep+deepAdd)+nid); queue.push(169*(nowDeep+deepAdd)+nid);
} }

View File

@ -17,8 +17,8 @@ main.floors.sample1 = {
[0, 246, 0, 1, 0, 0, 0, 2, 2, 221, 0, 221, 2], [0, 246, 0, 1, 0, 0, 0, 2, 2, 221, 0, 221, 2],
[246, 0, 246, 1, 0, 0, 0, 121, 85, 0, 0, 0, 2], [246, 0, 246, 1, 0, 0, 0, 121, 85, 0, 0, 0, 2],
[1, 246, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2], [1, 246, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 164, 0, 0, 163, 0, 0],
[1, 1, 1, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 0, 3, 0, 0, 0, 162, 0, 161, 0],
[1, 0, 123, 1, 0, 3, 124, 0, 121, 0, 122, 0, 126], [1, 0, 123, 1, 0, 3, 124, 0, 121, 0, 122, 0, 126],
[1, 0, 0, 1, 88, 3, 86, 0, 0, 0, 0, 0, 0], [1, 0, 0, 1, 88, 3, 86, 0, 0, 0, 0, 0, 0],
], ],

View File

@ -30,10 +30,10 @@ icons.prototype.init = function () {
'blueShop-right': 16, 'blueShop-right': 16,
'pinkShop-left': 17, 'pinkShop-left': 17,
'pinkShop-right': 18, 'pinkShop-right': 18,
'up': 19, 'arrowUp': 19,
'down': 20, 'arrowDown': 20,
'left': 21, 'arrowLeft': 21,
'right': 22, 'arrowRight': 22,
'light': 23, 'light': 23,
'darkLight': 24 'darkLight': 24
}, },

View File

@ -78,6 +78,7 @@ maps.prototype.getBlock = function (x, y, id) {
if (id == 12) tmp.event = {'cls': 'animates', 'id': 'poisonNet', 'noPass': false, 'trigger': 'passNet'}; // 毒网 if (id == 12) tmp.event = {'cls': 'animates', 'id': 'poisonNet', 'noPass': false, 'trigger': 'passNet'}; // 毒网
if (id == 13) tmp.event = {'cls': 'animates', 'id': 'weakNet', 'noPass': false, 'trigger': 'passNet'}; // 衰网 if (id == 13) tmp.event = {'cls': 'animates', 'id': 'weakNet', 'noPass': false, 'trigger': 'passNet'}; // 衰网
if (id == 14) tmp.event = {'cls': 'animates', 'id': 'curseNet', 'noPass': false, 'trigger': 'passNet'}; // 咒网 if (id == 14) tmp.event = {'cls': 'animates', 'id': 'curseNet', 'noPass': false, 'trigger': 'passNet'}; // 咒网
if (id == 15) tmp.event = {'cls': 'animates', 'id': 'water', 'noPass': true}; // 水 if (id == 15) tmp.event = {'cls': 'animates', 'id': 'water', 'noPass': true}; // 水
// autotile: 20 // autotile: 20
@ -162,10 +163,10 @@ maps.prototype.getBlock = function (x, y, id) {
if (id == 132) tmp.event = {'cls': 'npcs', 'id': 'princess'}; if (id == 132) tmp.event = {'cls': 'npcs', 'id': 'princess'};
// 161-200 其他(单向箭头、灯、箱子等等) // 161-200 其他(单向箭头、灯、箱子等等)
if (id == 161) tmp.event = {'cls': 'terrains', 'id': 'up'}; // 单向上箭头 if (id == 161) tmp.event = {'cls': 'terrains', 'id': 'arrowUp', 'noPass': false}; // 单向上箭头
if (id == 162) tmp.event = {'cls': 'terrains', 'id': 'down'}; // 单向下箭头 if (id == 162) tmp.event = {'cls': 'terrains', 'id': 'arrowDown', 'noPass': false}; // 单向下箭头
if (id == 163) tmp.event = {'cls': 'terrains', 'id': 'left'}; // 单向左箭头 if (id == 163) tmp.event = {'cls': 'terrains', 'id': 'arrowLeft', 'noPass': false}; // 单向左箭头
if (id == 164) tmp.event = {'cls': 'terrains', 'id': 'right'}; // 单向右箭头 if (id == 164) tmp.event = {'cls': 'terrains', 'id': 'arrowRight', 'noPass': false}; // 单向右箭头
if (id == 165) tmp.event = {'cls': 'terrains', 'id': 'light', 'trigger': 'changeLight', 'noPass': false}; // 灯 if (id == 165) tmp.event = {'cls': 'terrains', 'id': 'light', 'trigger': 'changeLight', 'noPass': false}; // 灯
if (id == 166) tmp.event = {'cls': 'terrains', 'id': 'darkLight', 'noPass': true}; // 暗灯 if (id == 166) tmp.event = {'cls': 'terrains', 'id': 'darkLight', 'noPass': true}; // 暗灯