activeVertexColor: 0x90b34f,
lines: [
{"x1": 375, "y1": 366, "x2": 200, "y2": 916}, {"x1": 200, "y1": 916, "x2": 664, "y2": 576}, {"x1": 664, "y1": 576, "x2": 88, "y2": 576}, {"x1": 88, "y1": 576, "x2": 556, "y2": 916}, {"x1": 556, "y1": 916, "x2": 375, "y2": 366} ]
},
{
name: "第⼆关",
lineColor: 0xe2e2e2,
vertexColor: 0x6dc6c0,
strokeColor: 0x416275, activeVertexColor: 0x6dc6c0,
lines: [
{"x1": 240, "y1": 460, "x2": 654, "y2": 875}, {"x1": 654, "y1": 875, "x2": 100, "y2": 740}, {"x1": 100, "y1": 740, "x2": 240, "y2": 460}, {"x1": 240, "y1": 460, "x2": 515, "y2": 460}, {"x1": 515, "y1": 460, "x2": 654, "y2": 740}, {"x1": 654, "y1": 740, "x2": 100, "y2": 875}, {"x1": 100, "y1": 875, "x2": 515, "y2": 460} ]
},
{
name: "第三关",
lineColor: 0xe2e2e2,
vertexColor: 0xec6a74,
strokeColor: 0x914748, activeVertexColor: 0xec6a74,
lines: [
{"x1": 177, "y1": 367, "x2": 177, "y2": 961}, {"x1": 177, "y1": 961, "x2": 673, "y2": 861},
{"x1": 673, "y1": 861, "x2": 177, "y2": 367},
{"x1": 177, "y1": 367, "x2": 572, "y2": 367},
{"x1": 572, "y1": 367, "x2": 78, "y2": 861},
{"x1": 78, "y1": 861, "x2": 572, "y2": 961},
{"x1": 572, "y1": 961, "x2": 572, "y2": 367}
]
},
{
name: "第四关",
src: "images/049.jpeg"
},
{
name: "第五关",
src: "images/053.jpeg"
},
电影源代码 下载{
name: "第六关",
src: "images/059.jpeg"
},
{
name: "第七关",
src: "images/401.jpeg"
}
]
}
);
// 兼容⼤屏幕适配
function fitEaselInfo() {
onestroke.viewLeft = document.querySelector(".wrapper").getBoundingClientRect().left; onestroke.ratio = 375 / Math.min(document.body.clientWidth, 540);
}
window.addEventListener("resize", fitEaselInfo);
fitEaselInfo();
// 通关
("pass", function() {
console.log("通关");
// 进⼊下⼀关
<();
});
// 进⼊新的⼀关
("start", function(curLevel) {
gameBack.innerHTML = curLevel.name;
});
// gameover
("gameover", function() {
alert("GAMEOVER");
});
// 关卡加载中
("level-loading", function() {
console.log("关卡" onestroke.curLevel " 加载中...")
});
("level-loaded", function() {
console.log("关卡" onestroke.curLevel " 加载成功")
});
// showOneStroke
let showOneStroke = function() {
ansform = ansform = "translate(-100%, 0)"; }
/
/ hideOneStroke
let hideOneStroke = function() {
ansform = ansform = "translate(0, 0)";
}
// 进⼊对应的关卡
let enter = function(index) {
showOneStroke();
<(index);
}
// 关卡列表初始化
let initLevels = function() {
let str = '';
function(level, index) {
str = '
\
' (index 1) '\
' level.name '\
'
}
);
levels.innerHTML = str;
/
/ 返回事件
gameBack.addEventListener("click", function() {hideOneStroke()});
// 重新开始
document.querySelector(".game-control-reset").addEventListener("click", function() {start()});
// 回退
document.querySelector(".game-control-rollback").addEventListener("click", function() { llback()}); }
// 调⽤初始化列表
initLevels();
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论