Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-libs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-libs
Commits
e4229d77
Commit
e4229d77
authored
Jul 20, 2020
by
zjz1994
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码暂存
parent
29b14f01
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
56 deletions
+68
-56
pintu.json
dist/customs/pintu.json
+1
-1
app.js
src/custom/pintu/debug/app.js
+6
-1
main.js
src/custom/pintu/debug/main.js
+24
-34
main.js.map
src/custom/pintu/debug/main.js.map
+1
-1
GameView.ts
src/custom/pintu/src/game/GameView.ts
+0
-1
qietu.ts
src/custom/pintu/src/game/qietu.ts
+36
-18
No files found.
dist/customs/pintu.json
View file @
e4229d77
...
...
@@ -128,5 +128,5 @@
}
},
"id"
:
"pintu"
,
"code"
:
"(function (global, factory) {
\n\t
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
\n\t
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
\n\t
(global = global || self, global.pintu = factory(global.tslib));
\n
}(this, (function (tslib) { 'use strict';
\n\n\t
var props = {};
\r\n\t
function prepareProps() {
\r\n\t
var metaProps = getProps();
\r\n\t
engine.injectProp(props, metaProps);
\r\n\t
}
\r\n\t
function injectProps(p) {
\r\n\t
engine.injectProp(props, p);
\r\n\t
}
\r\n\t
//# sourceMappingURL=props.js.map
\n\n\t
function getTexture(uuid) {
\r\n\t
return engine.Texture.from(getAssetByUUID(uuid).uuid);
\r\n\t
}
\r\n\t
function getTextureByName(name) {
\r\n\t
return getTexture(engine.getAssetByName(name).uuid);
\r\n\t
}
\r\n\t
function loadImageByUrl(url) {
\r\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\r\n\t
return tslib.__generator(this, function (_a) {
\r\n\t
console.log('loadImageByUrl----------:', url);
\r\n\t
return [2, new Promise(function (resolve) {
\r\n\t
if (engine.TextureCache[url]) {
\r\n\t
resolve(engine.TextureCache[url]);
\r\n\t
}
\r\n\t
else {
\r\n\t
var t = engine.Texture.from(url);
\r\n\t
t.addEventListener(
\"
loaded
\"
, function () { resolve(t); });
\r\n\t
}
\r\n\t
})];
\r\n\t
});
\r\n\t
});
\r\n\t
}
\r\n\t
//# sourceMappingURL=utils.js.map
\n\n\t
var qietu = (function (url, type1, rows, cols, parent) { return tslib.__awaiter(void 0, void 0, void 0, function () {
\r\n\t
var t, setimgwid, mwid1, mhei1, mwid, mhei, picarr, picnames, chax, chay, startlix, addlix, startliy, addliy, t
xt1, r, startx, endx, c, starty, endy, uvs, isprite, ispritename, e_1;
\r\n\t
return tslib.__generator(this, function (_a) {
\r\n\t
switch (_a.label) {
\r\n\t
case 0:
\r\n\t
_a.trys.push([0, 6, , 7]);
\r\n\t
t = void 0;
\r\n\t
if (!(type1 == 1)) return [3, 1];
\r\n\t
console.log(
\"
直接使用已加载的tex
\"
);
\r\n\t
t = url;
\r\n\t
return [3, 3];
\r\n\t
case 1: return [4, loadImageByUrl(url)];
\r\n\t
case 2:
\r\n\t
t = (_a.sent());
\r\n\t
_a.label = 3;
\r\n\t
case 3:
\r\n\t
setimgwid = 612;
\r\n\t
mwid1 = setimgwid / rows;
\r\n\t
mhei1 = setimgwid / cols;
\r\n\t
mwid = t.width;
\r\n\t
mhei = t.height;
\r\n\t
if (!(mwid < 10 || mhei < 10)) return [3, 5];
\r\n\t
console.log(
\"
调整222222222222
\"
);
\r\n\t
return [4, new Promise(function (res) {
\r\n\t
setTimeout(function () {
\r\n\t
res();
\r\n\t
}, 200);
\r\n\t
})];
\r\n\t
case 4:
\r\n\t
_a.sent();
\r\n\t
return [2, qietu(t, 1, rows, cols, parent)];
\r\n\t
case 5:
\r\n\t
console.log('图片', t);
\r\n\t
console.log(
\"
图片获取尺寸
\"
, mwid, mhei);
\r\n\t
if (mwid > mhei) {
\r\n\t
if (mhei < setimgwid) {
\r\n\t
mwid = mwid * setimgwid / mhei;
\r\n\t
mhei = setimgwid;
\r\n\t
}
\r\n\t
}
\r\n\t
else {
\r\n\t
if (mwid < setimgwid) {
\r\n\t
mhei = mhei * setimgwid / mwid;
\r\n\t
mwid = setimgwid;
\r\n\t
}
\r\n\t
}
\r\n\t
console.log(
\"
适配后的图片尺寸
\"
, mwid, mhei);
\r\n\t
picarr = {};
\r\n\t
picnames = [];
\r\n\t
chax = void 0;
\r\n\t
chay = void 0;
\r\n\t
startlix = void 0;
\r\n\t
addlix = void 0;
\r\n\t
startliy = void 0;
\r\n\t
addliy = void 0;
\r\n\t
if (mwid > mhei) {
\r\n\t
chax = (mwid - mhei) / 2;
\r\n\t
startlix = chax / mwid;
\r\n\t
addlix = (mhei / cols) / mwid;
\r\n\t
startliy = 0;
\r\n\t
addliy = 1 / rows;
\r\n\t
}
\r\n\t
else {
\r\n\t
startlix = 0;
\r\n\t
addlix = 1 / cols;
\r\n\t
chay = (mhei - mwid) / 2;
\r\n\t
startliy = chay / mhei;
\r\n\t
addliy = (mwid / rows) / mhei;
\r\n\t
}
\r\n\t
console.log(
\"
切图准备
\"
, startlix, addlix, startliy, addliy, mwid, mhei);
\r\n\t
txt1 = new engine.Label();
\r\n\t
txt1.fillColor =
\"
red
\"
;
\r\n\t
txt1.size = 24;
\r\n\t
txt1.text = startlix.toFixed(2) +
\"
;
\"
+ addlix.toFixed(2) +
\"
;
\"
+ startliy.toFixed(2) +
\"
;
\"
+ addliy.toFixed(2) +
\"
;
\"
+ mwid.toFixed(2) +
\"
;
\"
+ mhei.toFixed(2) +
\"
;
\"
;
\r\n\t
parent.addChild(txt1);
\r\n\t
txt1.y = -100;
\r\n\t
for (r = 0; r < rows; r++) {
\r\n\t
startx = startlix + addlix * r;
\r\n\t
endx = startx + addlix;
\r\n\t
for (c = 0; c < cols; c++) {
\r\n\t
starty = startliy + addliy * c;
\r\n\t
endy = starty + addliy;
\r\n\t
uvs = new Float32Array([
\r\n\t
starty,
\r\n\t
startx,
\r\n\t
endy,
\r\n\t
startx,
\r\n\t
endy,
\r\n\t
endx,
\r\n\t
starty,
\r\n\t
endx
\r\n\t
]);
\r\n\t
isprite = new engine.Sprite(t);
\r\n\t
isprite.uvs = uvs;
\r\n\t
isprite.width = mwid1;
\r\n\t
isprite.height = mhei1;
\r\n\t
ispritename =
\"
pic_
\"
+ c +
\"
_
\"
+ r;
\r\n\t
isprite.name = ispritename;
\r\n\t
picarr[ispritename] = isprite;
\r\n\t
picnames.push(ispritename);
\r\n\t
}
\r\n\t
}
\r\n\t
return [2, {
\r\n\t
res: true,
\r\n\t
picarr: picarr,
\r\n\t
mwid: mwid1,
\r\n\t
mhei: mhei1,
\r\n\t
picnames: picnames
\r\n\t
}];
\r\n\t
case 6:
\r\n\t
e_1 = _a.sent();
\r\n\t
console.error(
\"
图片加载失败
\"
, e_1);
\r\n\t
console.log(url, rows, cols);
\r\n\t
return [2, {
\r\n\t
res: false
\r\n\t
}];
\r\n\t
case 7: return [2];
\r\n\t
}
\r\n\t
});
\r\n\t
}); });
\n\n\t
var GameView = (function (_super) {
\r\n\t
tslib.__extends(GameView, _super);
\r\n\t
function GameView() {
\r\n\t
var _this = _super.call(this) || this;
\r\n\t
_this.ingame = false;
\r\n\t
_this.selectImgArr = [];
\r\n\t
_this.sucposData = {};
\r\n\t
_this.gameUrls = [];
\r\n\t
_this.gameTimes = [];
\r\n\t
_this.onegamePics = [];
\r\n\t
_this.movesteps = 0;
\r\n\t
_this.startime = 0;
\r\n\t
_this.once(engine.Event.ADDED_TO_STAGE, _this.initScene, _this);
\r\n\t
return _this;
\r\n\t
}
\r\n\t
GameView.prototype.initScene = function () {
\r\n\t
this.lineShape = new engine.Shape();
\r\n\t
this.selectimg3 = new engine.Image(getTextureByName(
\"
框3
\"
));
\r\n\t
this.selectimg4 = new engine.Image(getTextureByName(
\"
框4
\"
));
\r\n\t
this.selectimg3.mouseEnabled = false;
\r\n\t
this.selectimg4.mouseEnabled = false;
\r\n\t
this.dicont = new engine.Container();
\r\n\t
this.linecont = new engine.Container();
\r\n\t
this.blockcont = new engine.Container();
\r\n\t
this.addChild(this.dicont);
\r\n\t
this.addChild(this.linecont);
\r\n\t
this.addChild(this.blockcont);
\r\n\t
this.linecont.addChild(this.lineShape);
\r\n\t
console.log(
\"
拼图初始化完毕--------------
\"
);
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-initcomp
\"
, {});
\r\n\t
this.removeEventListener(engine.Event.ADDED_TO_STAGE, this.initScene, this);
\r\n\t
};
\r\n\t
GameView.prototype.initgame = function () {
\r\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\r\n\t
var l, lurl, lt;
\r\n\t
return tslib.__generator(this, function (_a) {
\r\n\t
switch (_a.label) {
\r\n\t
case 0:
\r\n\t
console.log(
\"
initgame---------
\"
);
\r\n\t
this.gameUrls = props.gameUrls;
\r\n\t
this.gameTimes = props.gameTimes;
\r\n\t
this.onegamePics = new Array();
\r\n\t
l = 0;
\r\n\t
_a.label = 1;
\r\n\t
case 1:
\r\n\t
if (!(l < this.gameUrls.length)) return [3, 4];
\r\n\t
lurl = this.gameUrls[l];
\r\n\t
return [4, loadImageByUrl(lurl)];
\r\n\t
case 2:
\r\n\t
lt = _a.sent();
\r\n\t
this.onegamePics.push(lt);
\r\n\t
if (this.onegamePics.length == 1) {
\r\n\t
this.startfirst();
\r\n\t
}
\r\n\t
_a.label = 3;
\r\n\t
case 3:
\r\n\t
l++;
\r\n\t
return [3, 1];
\r\n\t
case 4: return [2];
\r\n\t
}
\r\n\t
});
\r\n\t
});
\r\n\t
};
\r\n\t
GameView.prototype.startfirst = function () {
\r\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\r\n\t
var actidx, tex, type1, result, res, picarr, mwid, mhei, picnames, gap, r, c, ipicx, ipicy, npicname, ipic, rl, cl;
\r\n\t
return tslib.__generator(this, function (_a) {
\r\n\t
switch (_a.label) {
\r\n\t
case 0:
\r\n\t
this.dicont.removeChildren();
\r\n\t
this.movesteps = 0;
\r\n\t
this.startime = Date.now();
\r\n\t
actidx = 0;
\r\n\t
this.gametime = this.gameTimes[actidx];
\r\n\t
this.showtime = this.gameTimes[actidx];
\r\n\t
this.passtime = 0;
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
, {
\r\n\t
time: this.showtime,
\r\n\t
});
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
, {
\r\n\t
passtime: this.passtime
\r\n\t
});
\r\n\t
console.log(
\"
start-----------------
\"
, actidx);
\r\n\t
this.rows = 3;
\r\n\t
this.cols = 3;
\r\n\t
this.nselectimg = null;
\r\n\t
if (this.rows == 3) {
\r\n\t
this.nselectimg = this.selectimg3;
\r\n\t
}
\r\n\t
if (this.rows == 4) {
\r\n\t
this.nselectimg = this.selectimg4;
\r\n\t
}
\r\n\t
this.selectImgArr = new Array();
\r\n\t
this.sucposData = {};
\r\n\t
tex = this.onegamePics[actidx];
\r\n\t
type1 = 1;
\r\n\t
if (!tex) {
\r\n\t
tex = this.gameUrls[actidx];
\r\n\t
type1 = 2;
\r\n\t
}
\r\n\t
return [4, qietu(tex, type1, this.rows, this.cols, this.dicont)];
\r\n\t
case 1:
\r\n\t
result = _a.sent();
\r\n\t
res = result.res;
\r\n\t
if (res) {
\r\n\t
picarr = result.picarr;
\r\n\t
mwid = result.mwid;
\r\n\t
mhei = result.mhei;
\r\n\t
picnames = result.picnames;
\r\n\t
this.mwid = mwid;
\r\n\t
this.mhei = mhei;
\r\n\t
this.picarr = picarr;
\r\n\t
this.picnames = picnames;
\r\n\t
gap = 2;
\r\n\t
for (r = 0; r < this.rows; r++) {
\r\n\t
for (c = 0; c < this.cols; c++) {
\r\n\t
ipicx = mwid * c + gap;
\r\n\t
ipicy = mhei * r + gap;
\r\n\t
npicname =
\"
pic_
\"
+ c +
\"
_
\"
+ r;
\r\n\t
ipic = picarr[npicname];
\r\n\t
this.dicont.addChild(ipic);
\r\n\t
ipic.x = ipicx;
\r\n\t
ipic.y = ipicy;
\r\n\t
}
\r\n\t
}
\r\n\t
this.lineShape.clear();
\r\n\t
this.lineShape.beginStroke(0x0069df, 4, engine.LINE_CAP.BUTT, engine.LINE_JOIN.BEVEL, 100);
\r\n\t
this.lineShape.moveTo(0 + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(mhei * this.cols + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(mhei * this.cols + gap, mwid * this.rows + gap);
\r\n\t
this.lineShape.lineTo(0 + gap, mwid * this.rows + gap);
\r\n\t
this.lineShape.lineTo(0 + gap, 0 + gap);
\r\n\t
for (rl = 1; rl < this.rows; rl++) {
\r\n\t
this.lineShape.moveTo(0 + gap, rl * mhei + gap);
\r\n\t
this.lineShape.lineTo(mwid * this.cols + gap, rl * mhei + gap);
\r\n\t
}
\r\n\t
for (cl = 1; cl < this.cols; cl++) {
\r\n\t
this.lineShape.moveTo(cl * mwid + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(cl * mwid + gap, this.rows * mhei + gap);
\r\n\t
}
\r\n\t
this.lineShape.endStroke();
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-load-complete
\"
);
\r\n\t
this.ticker && clearInterval(this.ticker);
\r\n\t
this.ticker = setInterval(this.update, 10);
\r\n\t
}
\r\n\t
else {
\r\n\t
console.error(
\"
图片处理失败
\"
);
\r\n\t
}
\r\n\t
return [2];
\r\n\t
}
\r\n\t
});
\r\n\t
});
\r\n\t
};
\r\n\t
GameView.prototype.start = function () {
\r\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\r\n\t
var actidx, tex, type1, result, res, picarr, mwid, mhei, picnames, gap, r, c, ipicx, ipicy, npicname, ipic, rl, cl;
\r\n\t
return tslib.__generator(this, function (_a) {
\r\n\t
switch (_a.label) {
\r\n\t
case 0:
\r\n\t
this.dicont.removeChildren();
\r\n\t
this.movesteps = 0;
\r\n\t
this.startime = Date.now();
\r\n\t
actidx = props.actidx;
\r\n\t
this.gametime = this.gameTimes[actidx];
\r\n\t
this.showtime = this.gameTimes[actidx];
\r\n\t
this.passtime = 0;
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
, {
\r\n\t
time: this.showtime,
\r\n\t
});
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
, {
\r\n\t
passtime: this.passtime
\r\n\t
});
\r\n\t
console.log(
\"
start-----------------
\"
, actidx);
\r\n\t
this.rows = props.rows;
\r\n\t
this.cols = props.cols;
\r\n\t
this.nselectimg = null;
\r\n\t
if (this.rows == 3) {
\r\n\t
this.nselectimg = this.selectimg3;
\r\n\t
}
\r\n\t
if (this.rows == 4) {
\r\n\t
this.nselectimg = this.selectimg4;
\r\n\t
}
\r\n\t
this.selectImgArr = new Array();
\r\n\t
this.sucposData = {};
\r\n\t
tex = this.onegamePics[actidx];
\r\n\t
type1 = 1;
\r\n\t
if (!tex) {
\r\n\t
tex = this.gameUrls[actidx];
\r\n\t
type1 = 2;
\r\n\t
}
\r\n\t
return [4, qietu(tex, type1, this.rows, this.cols, this.dicont)];
\r\n\t
case 1:
\r\n\t
result = _a.sent();
\r\n\t
res = result.res;
\r\n\t
if (res) {
\r\n\t
picarr = result.picarr;
\r\n\t
mwid = result.mwid;
\r\n\t
mhei = result.mhei;
\r\n\t
picnames = result.picnames;
\r\n\t
this.mwid = mwid;
\r\n\t
this.mhei = mhei;
\r\n\t
this.picarr = picarr;
\r\n\t
this.picnames = picnames;
\r\n\t
gap = 2;
\r\n\t
for (r = 0; r < this.rows; r++) {
\r\n\t
for (c = 0; c < this.cols; c++) {
\r\n\t
ipicx = mwid * c + gap;
\r\n\t
ipicy = mhei * r + gap;
\r\n\t
npicname =
\"
pic_
\"
+ c +
\"
_
\"
+ r;
\r\n\t
ipic = picarr[npicname];
\r\n\t
this.dicont.addChild(ipic);
\r\n\t
ipic.x = ipicx;
\r\n\t
ipic.y = ipicy;
\r\n\t
}
\r\n\t
}
\r\n\t
this.lineShape.clear();
\r\n\t
this.lineShape.beginStroke(0x0069df, 4, engine.LINE_CAP.BUTT, engine.LINE_JOIN.BEVEL, 100);
\r\n\t
this.lineShape.moveTo(0 + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(mhei * this.cols + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(mhei * this.cols + gap, mwid * this.rows + gap);
\r\n\t
this.lineShape.lineTo(0 + gap, mwid * this.rows + gap);
\r\n\t
this.lineShape.lineTo(0 + gap, 0 + gap);
\r\n\t
for (rl = 1; rl < this.rows; rl++) {
\r\n\t
this.lineShape.moveTo(0 + gap, rl * mhei + gap);
\r\n\t
this.lineShape.lineTo(mwid * this.cols + gap, rl * mhei + gap);
\r\n\t
}
\r\n\t
for (cl = 1; cl < this.cols; cl++) {
\r\n\t
this.lineShape.moveTo(cl * mwid + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(cl * mwid + gap, this.rows * mhei + gap);
\r\n\t
}
\r\n\t
this.lineShape.endStroke();
\r\n\t
this.ticker && clearInterval(this.ticker);
\r\n\t
this.ticker = setInterval(this.update, 10);
\r\n\t
}
\r\n\t
else {
\r\n\t
console.error(
\"
图片处理失败
\"
);
\r\n\t
}
\r\n\t
return [2];
\r\n\t
}
\r\n\t
});
\r\n\t
});
\r\n\t
};
\r\n\t
GameView.prototype.luanxu = function () {
\r\n\t
var gap = 2;
\r\n\t
for (var r = 0; r < this.rows; r++) {
\r\n\t
for (var c = 0; c < this.cols; c++) {
\r\n\t
var ipicx = this.mwid * c + gap;
\r\n\t
var ipicy = this.mhei * r + gap;
\r\n\t
var npicname =
\"
pic_
\"
+ c +
\"
_
\"
+ r;
\r\n\t
this.sucposData[npicname] = r +
\"
_
\"
+ c;
\r\n\t
var selidx = Math.floor(Math.random() * this.picnames.length);
\r\n\t
var ipicname = this.picnames[selidx];
\r\n\t
if (r == c && r != this.rows - 1) {
\r\n\t
while (ipicname == npicname) {
\r\n\t
selidx = Math.floor(Math.random() * this.picnames.length);
\r\n\t
ipicname = this.picnames[selidx];
\r\n\t
}
\r\n\t
}
\r\n\t
var ipic = this.picarr[ipicname];
\r\n\t
this.picnames.splice(selidx, 1);
\r\n\t
ipic.x = ipicx;
\r\n\t
ipic.y = ipicy;
\r\n\t
ipic[
\"
postr
\"
] = r +
\"
_
\"
+ c;
\r\n\t
ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.touchPic, this);
\r\n\t
}
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.pause = function () {
\r\n\t
this.ingame = false;
\r\n\t
console.error(
\"
拼图暂停
\"
);
\r\n\t
};
\r\n\t
GameView.prototype.resume = function () {
\r\n\t
this.lastframetime = Date.now();
\r\n\t
this.ingame = true;
\r\n\t
console.error(
\"
拼图继续
\"
);
\r\n\t
};
\r\n\t
GameView.prototype.update = function () {
\r\n\t
var ntime = Date.now();
\r\n\t
if (!this.lastframetime) {
\r\n\t
this.lastframetime = ntime;
\r\n\t
return;
\r\n\t
}
\r\n\t
if (this.ingame) {
\r\n\t
var passtime = (ntime - this.lastframetime) / 1000;
\r\n\t
this.passtime += passtime;
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
, {
\r\n\t
passtime: this.passtime
\r\n\t
});
\r\n\t
var showtime1 = Math.round(this.gametime - this.passtime);
\r\n\t
if (this.showtime != showtime1) {
\r\n\t
this.showtime = showtime1;
\r\n\t
if (this.showtime <= 0) {
\r\n\t
this.showtime = 0;
\r\n\t
this.gameover(2);
\r\n\t
}
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
, {
\r\n\t
time: this.showtime
\r\n\t
});
\r\n\t
}
\r\n\t
}
\r\n\t
this.lastframetime = ntime;
\r\n\t
};
\r\n\t
GameView.prototype.touchPic = function (e) {
\r\n\t
if (!this.ingame) {
\r\n\t
return;
\r\n\t
}
\r\n\t
var selectname = e.target.name;
\r\n\t
var spx = e.target.x;
\r\n\t
var spy = e.target.y;
\r\n\t
var gap = 2;
\r\n\t
if (this.selectImgArr.length == 0) {
\r\n\t
if (this.nselectimg) {
\r\n\t
this.blockcont.addChild(this.nselectimg);
\r\n\t
this.nselectimg.x = spx - gap;
\r\n\t
this.nselectimg.y = spy - gap;
\r\n\t
}
\r\n\t
this.selectImgArr.push(selectname);
\r\n\t
}
\r\n\t
else if (this.selectImgArr.length == 1) {
\r\n\t
if (selectname == this.selectImgArr[0]) {
\r\n\t
if (this.nselectimg) {
\r\n\t
this.blockcont.removeChild(this.nselectimg);
\r\n\t
}
\r\n\t
this.selectImgArr = new Array();
\r\n\t
return;
\r\n\t
}
\r\n\t
else {
\r\n\t
this.selectImgArr.push(selectname);
\r\n\t
this.changeImgPos();
\r\n\t
}
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.changeImgPos = function () {
\r\n\t
var img1name = this.selectImgArr[0];
\r\n\t
var img2name = this.selectImgArr[1];
\r\n\t
var img1 = this.dicont.getChildByName(img1name);
\r\n\t
var img2 = this.dicont.getChildByName(img2name);
\r\n\t
var imgpos1x = img1.x;
\r\n\t
var imgpos1y = img1.y;
\r\n\t
var imgpos2x = img2.x;
\r\n\t
var imgpos2y = img2.y;
\r\n\t
var imgpostr1 = img1.postr;
\r\n\t
var imgpostr2 = img2.postr;
\r\n\t
img1.x = imgpos2x;
\r\n\t
img1.y = imgpos2y;
\r\n\t
img1.postr = imgpostr2;
\r\n\t
img2.x = imgpos1x;
\r\n\t
img2.y = imgpos1y;
\r\n\t
img2.postr = imgpostr1;
\r\n\t
this.selectImgArr = new Array();
\r\n\t
this.movesteps += 1;
\r\n\t
if (this.nselectimg) {
\r\n\t
this.blockcont.removeChild(this.nselectimg);
\r\n\t
}
\r\n\t
var isuc = this.checkSuccess();
\r\n\t
if (isuc) {
\r\n\t
console.error(
\"
成功过关
\"
);
\r\n\t
this.gameover(1);
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.checkSuccess = function () {
\r\n\t
var isuc = true;
\r\n\t
for (var r = 0; r < this.rows; r++) {
\r\n\t
for (var c = 0; c < this.cols; c++) {
\r\n\t
var ipicname =
\"
pic_
\"
+ c +
\"
_
\"
+ r;
\r\n\t
var npicstr = r +
\"
_
\"
+ c;
\r\n\t
var ipic = this.dicont.getChildByName(ipicname);
\r\n\t
var ipostr = ipic.postr;
\r\n\t
if (npicstr != ipostr) {
\r\n\t
isuc = false;
\r\n\t
break;
\r\n\t
}
\r\n\t
}
\r\n\t
}
\r\n\t
return isuc;
\r\n\t
};
\r\n\t
GameView.prototype.gameover = function (reason) {
\r\n\t
this.ingame = false;
\r\n\t
this.ticker && clearInterval(this.ticker);
\r\n\t
var ntime = Date.now();
\r\n\t
var gametime = ntime - this.startime;
\r\n\t
engine.globalEvent.dispatchEvent('pictures-game-over', {
\r\n\t
reason: reason,
\r\n\t
time: this.passtime,
\r\n\t
number: this.movesteps,
\r\n\t
gametime: gametime
\r\n\t
});
\r\n\t
};
\r\n\t
return GameView;
\r\n\t
}(engine.Container));
\r\n\t
//# sourceMappingURL=GameView.js.map
\n\n\t
var GameWrapper = (function (_super) {
\r\n\t
tslib.__extends(GameWrapper, _super);
\r\n\t
function GameWrapper() {
\r\n\t
var _this = _super.call(this) || this;
\r\n\t
_this._gameView = new GameView();
\r\n\t
_this.addChild(_this._gameView);
\r\n\t
engine.globalEvent.addEventListener('pictures-initgame', _this.initgame, _this);
\r\n\t
engine.globalEvent.addEventListener('pictures-start', _this.start, _this);
\r\n\t
engine.globalEvent.addEventListener('pictures-luanxu', _this.luanxu, _this);
\r\n\t
engine.globalEvent.addEventListener('pictures-pause', _this.pause, _this);
\r\n\t
engine.globalEvent.addEventListener('pictures-resume', _this.resume, _this);
\r\n\t
return _this;
\r\n\t
}
\r\n\t
GameWrapper.prototype.initgame = function (event) {
\r\n\t
injectProps(event.data);
\r\n\t
this._gameView.initgame();
\r\n\t
};
\r\n\t
GameWrapper.prototype.start = function (event) {
\r\n\t
injectProps(event.data);
\r\n\t
this._gameView.start();
\r\n\t
};
\r\n\t
GameWrapper.prototype.luanxu = function () {
\r\n\t
this._gameView.luanxu();
\r\n\t
};
\r\n\t
GameWrapper.prototype.pause = function (event) {
\r\n\t
this._gameView.pause();
\r\n\t
};
\r\n\t
GameWrapper.prototype.resume = function (event) {
\r\n\t
this._gameView.resume();
\r\n\t
};
\r\n\t
return GameWrapper;
\r\n\t
}(engine.Container));
\r\n\t
//# sourceMappingURL=GameWrapper.js.map
\n\n\t
function index (props) {
\r\n\t
prepareProps();
\r\n\t
injectProps(props);
\r\n\t
var instance = new GameWrapper();
\r\n\t
return instance;
\r\n\t
}
\r\n\t
//# sourceMappingURL=index.js.map
\n\n\t
return index;
\n\n
})));
\n
"
"code"
:
"(function (global, factory) {
\n\t
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('tslib')) :
\n\t
typeof define === 'function' && define.amd ? define(['tslib'], factory) :
\n\t
(global = global || self, global.pintu = factory(global.tslib));
\n
}(this, (function (tslib) { 'use strict';
\n\n\t
var props = {};
\r\n\t
function prepareProps() {
\r\n\t
var metaProps = getProps();
\r\n\t
engine.injectProp(props, metaProps);
\r\n\t
}
\r\n\t
function injectProps(p) {
\r\n\t
engine.injectProp(props, p);
\r\n\t
}
\r\n\t
//# sourceMappingURL=props.js.map
\n\n\t
function getTexture(uuid) {
\r\n\t
return engine.Texture.from(getAssetByUUID(uuid).uuid);
\r\n\t
}
\r\n\t
function getTextureByName(name) {
\r\n\t
return getTexture(engine.getAssetByName(name).uuid);
\r\n\t
}
\r\n\t
function loadImageByUrl(url) {
\r\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\r\n\t
return tslib.__generator(this, function (_a) {
\r\n\t
console.log('loadImageByUrl----------:', url);
\r\n\t
return [2, new Promise(function (resolve) {
\r\n\t
if (engine.TextureCache[url]) {
\r\n\t
resolve(engine.TextureCache[url]);
\r\n\t
}
\r\n\t
else {
\r\n\t
var t = engine.Texture.from(url);
\r\n\t
t.addEventListener(
\"
loaded
\"
, function () { resolve(t); });
\r\n\t
}
\r\n\t
})];
\r\n\t
});
\r\n\t
});
\r\n\t
}
\r\n\t
//# sourceMappingURL=utils.js.map
\n\n\t
var qietu = (function (url, type1, rows, cols, parent) { return tslib.__awaiter(void 0, void 0, void 0, function () {
\r\n\t
var t, setimgwid, mwid1, mhei1, mwid, mhei, picarr, picnames, chax, chay, startlix, addlix, startliy, addliy, t
wid1, thei1, r, startx, c, starty, nsprite, isprite, nsp, ispritename, e_1;
\r\n\t
return tslib.__generator(this, function (_a) {
\r\n\t
switch (_a.label) {
\r\n\t
case 0:
\r\n\t
_a.trys.push([0, 6, , 7]);
\r\n\t
t = void 0;
\r\n\t
if (!(type1 == 1)) return [3, 1];
\r\n\t
t = url;
\r\n\t
return [3, 3];
\r\n\t
case 1: return [4, loadImageByUrl(url)];
\r\n\t
case 2:
\r\n\t
t = (_a.sent());
\r\n\t
_a.label = 3;
\r\n\t
case 3:
\r\n\t
setimgwid = 612;
\r\n\t
mwid1 = setimgwid / rows;
\r\n\t
mhei1 = setimgwid / cols;
\r\n\t
mwid = t.width;
\r\n\t
mhei = t.height;
\r\n\t
if (!(mwid < 10 || mhei < 10)) return [3, 5];
\r\n\t
return [4, new Promise(function (res) {
\r\n\t
setTimeout(function () {
\r\n\t
res();
\r\n\t
}, 200);
\r\n\t
})];
\r\n\t
case 4:
\r\n\t
_a.sent();
\r\n\t
return [2, qietu(t, 1, rows, cols)];
\r\n\t
case 5:
\r\n\t
if (mwid > mhei) {
\r\n\t
if (mhei < setimgwid) {
\r\n\t
mwid = mwid * setimgwid / mhei;
\r\n\t
mhei = setimgwid;
\r\n\t
}
\r\n\t
}
\r\n\t
else {
\r\n\t
if (mwid < setimgwid) {
\r\n\t
mhei = mhei * setimgwid / mwid;
\r\n\t
mwid = setimgwid;
\r\n\t
}
\r\n\t
}
\r\n\t
picarr = {};
\r\n\t
picnames = [];
\r\n\t
chax = void 0;
\r\n\t
chay = void 0;
\r\n\t
startlix = void 0;
\r\n\t
addlix = void 0;
\r\n\t
startliy = void 0;
\r\n\t
addliy = void 0;
\r\n\t
twid1 = void 0;
\r\n\t
thei1 = void 0;
\r\n\t
if (mwid > mhei) {
\r\n\t
chax = (mwid - mhei) / 2;
\r\n\t
startlix = chax / mwid;
\r\n\t
addlix = (mhei / cols) / mwid;
\r\n\t
startliy = 0;
\r\n\t
addliy = 1 / rows;
\r\n\t
twid1 = mwid * setimgwid / mhei;
\r\n\t
thei1 = setimgwid;
\r\n\t
}
\r\n\t
else {
\r\n\t
startlix = 0;
\r\n\t
addlix = 1 / cols;
\r\n\t
chay = (mhei - mwid) / 2;
\r\n\t
startliy = chay / mhei;
\r\n\t
addliy = (mwid / rows) / mhei;
\r\n\t
thei1 = mhei * setimgwid / mwid;
\r\n\t
twid1 = setimgwid;
\r\n\t
}
\r\n\t
for (r = 0; r < rows; r++) {
\r\n\t
startx = startlix + addlix * r;
\r\n\t
for (c = 0; c < cols; c++) {
\r\n\t
starty = startliy + addliy * c;
\r\n\t
nsprite = new engine.Container();
\r\n\t
isprite = new engine.ScrollView();
\r\n\t
nsp = new engine.Sprite(t);
\r\n\t
isprite.addChild(nsp);
\r\n\t
nsp.width = twid1;
\r\n\t
nsp.height = thei1;
\r\n\t
isprite.mouseEnabled = false;
\r\n\t
isprite.mouseChildren = false;
\r\n\t
nsp.x = -starty * twid1;
\r\n\t
nsp.y = -startx * thei1;
\r\n\t
isprite.width = mwid1;
\r\n\t
isprite.height = mhei1;
\r\n\t
nsprite.addChild(isprite);
\r\n\t
nsprite.width = mwid1;
\r\n\t
nsprite.height = mhei1;
\r\n\t
ispritename =
\"
pic_
\"
+ c +
\"
_
\"
+ r;
\r\n\t
nsprite.name = ispritename;
\r\n\t
picarr[ispritename] = nsprite;
\r\n\t
picnames.push(ispritename);
\r\n\t
}
\r\n\t
}
\r\n\t
return [2, {
\r\n\t
res: true,
\r\n\t
picarr: picarr,
\r\n\t
mwid: mwid1,
\r\n\t
mhei: mhei1,
\r\n\t
picnames: picnames
\r\n\t
}];
\r\n\t
case 6:
\r\n\t
e_1 = _a.sent();
\r\n\t
return [2, {
\r\n\t
res: false
\r\n\t
}];
\r\n\t
case 7: return [2];
\r\n\t
}
\r\n\t
});
\r\n\t
}); });
\r\n\t
//# sourceMappingURL=qietu.js.map
\n\n\t
var GameView = (function (_super) {
\r\n\t
tslib.__extends(GameView, _super);
\r\n\t
function GameView() {
\r\n\t
var _this = _super.call(this) || this;
\r\n\t
_this.ingame = false;
\r\n\t
_this.selectImgArr = [];
\r\n\t
_this.sucposData = {};
\r\n\t
_this.gameUrls = [];
\r\n\t
_this.gameTimes = [];
\r\n\t
_this.onegamePics = [];
\r\n\t
_this.movesteps = 0;
\r\n\t
_this.startime = 0;
\r\n\t
_this.once(engine.Event.ADDED_TO_STAGE, _this.initScene, _this);
\r\n\t
return _this;
\r\n\t
}
\r\n\t
GameView.prototype.initScene = function () {
\r\n\t
this.lineShape = new engine.Shape();
\r\n\t
this.selectimg3 = new engine.Image(getTextureByName(
\"
框3
\"
));
\r\n\t
this.selectimg4 = new engine.Image(getTextureByName(
\"
框4
\"
));
\r\n\t
this.selectimg3.mouseEnabled = false;
\r\n\t
this.selectimg4.mouseEnabled = false;
\r\n\t
this.dicont = new engine.Container();
\r\n\t
this.linecont = new engine.Container();
\r\n\t
this.blockcont = new engine.Container();
\r\n\t
this.addChild(this.dicont);
\r\n\t
this.addChild(this.linecont);
\r\n\t
this.addChild(this.blockcont);
\r\n\t
this.linecont.addChild(this.lineShape);
\r\n\t
console.log(
\"
拼图初始化完毕--------------
\"
);
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-initcomp
\"
, {});
\r\n\t
this.removeEventListener(engine.Event.ADDED_TO_STAGE, this.initScene, this);
\r\n\t
};
\r\n\t
GameView.prototype.initgame = function () {
\r\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\r\n\t
var l, lurl, lt;
\r\n\t
return tslib.__generator(this, function (_a) {
\r\n\t
switch (_a.label) {
\r\n\t
case 0:
\r\n\t
console.log(
\"
initgame---------
\"
);
\r\n\t
this.gameUrls = props.gameUrls;
\r\n\t
this.gameTimes = props.gameTimes;
\r\n\t
this.onegamePics = new Array();
\r\n\t
l = 0;
\r\n\t
_a.label = 1;
\r\n\t
case 1:
\r\n\t
if (!(l < this.gameUrls.length)) return [3, 4];
\r\n\t
lurl = this.gameUrls[l];
\r\n\t
return [4, loadImageByUrl(lurl)];
\r\n\t
case 2:
\r\n\t
lt = _a.sent();
\r\n\t
this.onegamePics.push(lt);
\r\n\t
if (this.onegamePics.length == 1) {
\r\n\t
this.startfirst();
\r\n\t
}
\r\n\t
_a.label = 3;
\r\n\t
case 3:
\r\n\t
l++;
\r\n\t
return [3, 1];
\r\n\t
case 4: return [2];
\r\n\t
}
\r\n\t
});
\r\n\t
});
\r\n\t
};
\r\n\t
GameView.prototype.startfirst = function () {
\r\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\r\n\t
var actidx, tex, type1, result, res, picarr, mwid, mhei, picnames, gap, r, c, ipicx, ipicy, npicname, ipic, rl, cl;
\r\n\t
return tslib.__generator(this, function (_a) {
\r\n\t
switch (_a.label) {
\r\n\t
case 0:
\r\n\t
this.dicont.removeChildren();
\r\n\t
this.movesteps = 0;
\r\n\t
this.startime = Date.now();
\r\n\t
actidx = 0;
\r\n\t
this.gametime = this.gameTimes[actidx];
\r\n\t
this.showtime = this.gameTimes[actidx];
\r\n\t
this.passtime = 0;
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
, {
\r\n\t
time: this.showtime,
\r\n\t
});
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
, {
\r\n\t
passtime: this.passtime
\r\n\t
});
\r\n\t
console.log(
\"
start-----------------
\"
, actidx);
\r\n\t
this.rows = 3;
\r\n\t
this.cols = 3;
\r\n\t
this.nselectimg = null;
\r\n\t
if (this.rows == 3) {
\r\n\t
this.nselectimg = this.selectimg3;
\r\n\t
}
\r\n\t
if (this.rows == 4) {
\r\n\t
this.nselectimg = this.selectimg4;
\r\n\t
}
\r\n\t
this.selectImgArr = new Array();
\r\n\t
this.sucposData = {};
\r\n\t
tex = this.onegamePics[actidx];
\r\n\t
type1 = 1;
\r\n\t
if (!tex) {
\r\n\t
tex = this.gameUrls[actidx];
\r\n\t
type1 = 2;
\r\n\t
}
\r\n\t
return [4, qietu(tex, type1, this.rows, this.cols, this.dicont)];
\r\n\t
case 1:
\r\n\t
result = _a.sent();
\r\n\t
res = result.res;
\r\n\t
if (res) {
\r\n\t
picarr = result.picarr;
\r\n\t
mwid = result.mwid;
\r\n\t
mhei = result.mhei;
\r\n\t
picnames = result.picnames;
\r\n\t
this.mwid = mwid;
\r\n\t
this.mhei = mhei;
\r\n\t
this.picarr = picarr;
\r\n\t
this.picnames = picnames;
\r\n\t
gap = 2;
\r\n\t
for (r = 0; r < this.rows; r++) {
\r\n\t
for (c = 0; c < this.cols; c++) {
\r\n\t
ipicx = mwid * c + gap;
\r\n\t
ipicy = mhei * r + gap;
\r\n\t
npicname =
\"
pic_
\"
+ c +
\"
_
\"
+ r;
\r\n\t
ipic = picarr[npicname];
\r\n\t
this.dicont.addChild(ipic);
\r\n\t
ipic.x = ipicx;
\r\n\t
ipic.y = ipicy;
\r\n\t
}
\r\n\t
}
\r\n\t
this.lineShape.clear();
\r\n\t
this.lineShape.beginStroke(0x0069df, 4, engine.LINE_CAP.BUTT, engine.LINE_JOIN.BEVEL, 100);
\r\n\t
this.lineShape.moveTo(0 + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(mhei * this.cols + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(mhei * this.cols + gap, mwid * this.rows + gap);
\r\n\t
this.lineShape.lineTo(0 + gap, mwid * this.rows + gap);
\r\n\t
this.lineShape.lineTo(0 + gap, 0 + gap);
\r\n\t
for (rl = 1; rl < this.rows; rl++) {
\r\n\t
this.lineShape.moveTo(0 + gap, rl * mhei + gap);
\r\n\t
this.lineShape.lineTo(mwid * this.cols + gap, rl * mhei + gap);
\r\n\t
}
\r\n\t
for (cl = 1; cl < this.cols; cl++) {
\r\n\t
this.lineShape.moveTo(cl * mwid + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(cl * mwid + gap, this.rows * mhei + gap);
\r\n\t
}
\r\n\t
this.lineShape.endStroke();
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-load-complete
\"
);
\r\n\t
this.ticker && clearInterval(this.ticker);
\r\n\t
this.ticker = setInterval(this.update, 10);
\r\n\t
}
\r\n\t
else {
\r\n\t
console.error(
\"
图片处理失败
\"
);
\r\n\t
}
\r\n\t
return [2];
\r\n\t
}
\r\n\t
});
\r\n\t
});
\r\n\t
};
\r\n\t
GameView.prototype.start = function () {
\r\n\t
return tslib.__awaiter(this, void 0, void 0, function () {
\r\n\t
var actidx, tex, type1, result, res, picarr, mwid, mhei, picnames, gap, r, c, ipicx, ipicy, npicname, ipic, rl, cl;
\r\n\t
return tslib.__generator(this, function (_a) {
\r\n\t
switch (_a.label) {
\r\n\t
case 0:
\r\n\t
this.dicont.removeChildren();
\r\n\t
this.movesteps = 0;
\r\n\t
this.startime = Date.now();
\r\n\t
actidx = props.actidx;
\r\n\t
this.gametime = this.gameTimes[actidx];
\r\n\t
this.showtime = this.gameTimes[actidx];
\r\n\t
this.passtime = 0;
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
, {
\r\n\t
time: this.showtime,
\r\n\t
});
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
, {
\r\n\t
passtime: this.passtime
\r\n\t
});
\r\n\t
this.rows = props.rows;
\r\n\t
this.cols = props.cols;
\r\n\t
this.nselectimg = null;
\r\n\t
if (this.rows == 3) {
\r\n\t
this.nselectimg = this.selectimg3;
\r\n\t
}
\r\n\t
if (this.rows == 4) {
\r\n\t
this.nselectimg = this.selectimg4;
\r\n\t
}
\r\n\t
this.selectImgArr = new Array();
\r\n\t
this.sucposData = {};
\r\n\t
tex = this.onegamePics[actidx];
\r\n\t
type1 = 1;
\r\n\t
if (!tex) {
\r\n\t
tex = this.gameUrls[actidx];
\r\n\t
type1 = 2;
\r\n\t
}
\r\n\t
return [4, qietu(tex, type1, this.rows, this.cols, this.dicont)];
\r\n\t
case 1:
\r\n\t
result = _a.sent();
\r\n\t
res = result.res;
\r\n\t
if (res) {
\r\n\t
picarr = result.picarr;
\r\n\t
mwid = result.mwid;
\r\n\t
mhei = result.mhei;
\r\n\t
picnames = result.picnames;
\r\n\t
this.mwid = mwid;
\r\n\t
this.mhei = mhei;
\r\n\t
this.picarr = picarr;
\r\n\t
this.picnames = picnames;
\r\n\t
gap = 2;
\r\n\t
for (r = 0; r < this.rows; r++) {
\r\n\t
for (c = 0; c < this.cols; c++) {
\r\n\t
ipicx = mwid * c + gap;
\r\n\t
ipicy = mhei * r + gap;
\r\n\t
npicname =
\"
pic_
\"
+ c +
\"
_
\"
+ r;
\r\n\t
ipic = picarr[npicname];
\r\n\t
this.dicont.addChild(ipic);
\r\n\t
ipic.x = ipicx;
\r\n\t
ipic.y = ipicy;
\r\n\t
}
\r\n\t
}
\r\n\t
this.lineShape.clear();
\r\n\t
this.lineShape.beginStroke(0x0069df, 4, engine.LINE_CAP.BUTT, engine.LINE_JOIN.BEVEL, 100);
\r\n\t
this.lineShape.moveTo(0 + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(mhei * this.cols + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(mhei * this.cols + gap, mwid * this.rows + gap);
\r\n\t
this.lineShape.lineTo(0 + gap, mwid * this.rows + gap);
\r\n\t
this.lineShape.lineTo(0 + gap, 0 + gap);
\r\n\t
for (rl = 1; rl < this.rows; rl++) {
\r\n\t
this.lineShape.moveTo(0 + gap, rl * mhei + gap);
\r\n\t
this.lineShape.lineTo(mwid * this.cols + gap, rl * mhei + gap);
\r\n\t
}
\r\n\t
for (cl = 1; cl < this.cols; cl++) {
\r\n\t
this.lineShape.moveTo(cl * mwid + gap, 0 + gap);
\r\n\t
this.lineShape.lineTo(cl * mwid + gap, this.rows * mhei + gap);
\r\n\t
}
\r\n\t
this.lineShape.endStroke();
\r\n\t
this.ticker && clearInterval(this.ticker);
\r\n\t
this.ticker = setInterval(this.update, 10);
\r\n\t
}
\r\n\t
else {
\r\n\t
console.error(
\"
图片处理失败
\"
);
\r\n\t
}
\r\n\t
return [2];
\r\n\t
}
\r\n\t
});
\r\n\t
});
\r\n\t
};
\r\n\t
GameView.prototype.luanxu = function () {
\r\n\t
var gap = 2;
\r\n\t
for (var r = 0; r < this.rows; r++) {
\r\n\t
for (var c = 0; c < this.cols; c++) {
\r\n\t
var ipicx = this.mwid * c + gap;
\r\n\t
var ipicy = this.mhei * r + gap;
\r\n\t
var npicname =
\"
pic_
\"
+ c +
\"
_
\"
+ r;
\r\n\t
this.sucposData[npicname] = r +
\"
_
\"
+ c;
\r\n\t
var selidx = Math.floor(Math.random() * this.picnames.length);
\r\n\t
var ipicname = this.picnames[selidx];
\r\n\t
if (r == c && r != this.rows - 1) {
\r\n\t
while (ipicname == npicname) {
\r\n\t
selidx = Math.floor(Math.random() * this.picnames.length);
\r\n\t
ipicname = this.picnames[selidx];
\r\n\t
}
\r\n\t
}
\r\n\t
var ipic = this.picarr[ipicname];
\r\n\t
this.picnames.splice(selidx, 1);
\r\n\t
ipic.x = ipicx;
\r\n\t
ipic.y = ipicy;
\r\n\t
ipic[
\"
postr
\"
] = r +
\"
_
\"
+ c;
\r\n\t
ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN, this.touchPic, this);
\r\n\t
}
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.pause = function () {
\r\n\t
this.ingame = false;
\r\n\t
console.error(
\"
拼图暂停
\"
);
\r\n\t
};
\r\n\t
GameView.prototype.resume = function () {
\r\n\t
this.lastframetime = Date.now();
\r\n\t
this.ingame = true;
\r\n\t
console.error(
\"
拼图继续
\"
);
\r\n\t
};
\r\n\t
GameView.prototype.update = function () {
\r\n\t
var ntime = Date.now();
\r\n\t
if (!this.lastframetime) {
\r\n\t
this.lastframetime = ntime;
\r\n\t
return;
\r\n\t
}
\r\n\t
if (this.ingame) {
\r\n\t
var passtime = (ntime - this.lastframetime) / 1000;
\r\n\t
this.passtime += passtime;
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
, {
\r\n\t
passtime: this.passtime
\r\n\t
});
\r\n\t
var showtime1 = Math.round(this.gametime - this.passtime);
\r\n\t
if (this.showtime != showtime1) {
\r\n\t
this.showtime = showtime1;
\r\n\t
if (this.showtime <= 0) {
\r\n\t
this.showtime = 0;
\r\n\t
this.gameover(2);
\r\n\t
}
\r\n\t
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
, {
\r\n\t
time: this.showtime
\r\n\t
});
\r\n\t
}
\r\n\t
}
\r\n\t
this.lastframetime = ntime;
\r\n\t
};
\r\n\t
GameView.prototype.touchPic = function (e) {
\r\n\t
if (!this.ingame) {
\r\n\t
return;
\r\n\t
}
\r\n\t
var selectname = e.target.name;
\r\n\t
var spx = e.target.x;
\r\n\t
var spy = e.target.y;
\r\n\t
var gap = 2;
\r\n\t
if (this.selectImgArr.length == 0) {
\r\n\t
if (this.nselectimg) {
\r\n\t
this.blockcont.addChild(this.nselectimg);
\r\n\t
this.nselectimg.x = spx - gap;
\r\n\t
this.nselectimg.y = spy - gap;
\r\n\t
}
\r\n\t
this.selectImgArr.push(selectname);
\r\n\t
}
\r\n\t
else if (this.selectImgArr.length == 1) {
\r\n\t
if (selectname == this.selectImgArr[0]) {
\r\n\t
if (this.nselectimg) {
\r\n\t
this.blockcont.removeChild(this.nselectimg);
\r\n\t
}
\r\n\t
this.selectImgArr = new Array();
\r\n\t
return;
\r\n\t
}
\r\n\t
else {
\r\n\t
this.selectImgArr.push(selectname);
\r\n\t
this.changeImgPos();
\r\n\t
}
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.changeImgPos = function () {
\r\n\t
var img1name = this.selectImgArr[0];
\r\n\t
var img2name = this.selectImgArr[1];
\r\n\t
var img1 = this.dicont.getChildByName(img1name);
\r\n\t
var img2 = this.dicont.getChildByName(img2name);
\r\n\t
var imgpos1x = img1.x;
\r\n\t
var imgpos1y = img1.y;
\r\n\t
var imgpos2x = img2.x;
\r\n\t
var imgpos2y = img2.y;
\r\n\t
var imgpostr1 = img1.postr;
\r\n\t
var imgpostr2 = img2.postr;
\r\n\t
img1.x = imgpos2x;
\r\n\t
img1.y = imgpos2y;
\r\n\t
img1.postr = imgpostr2;
\r\n\t
img2.x = imgpos1x;
\r\n\t
img2.y = imgpos1y;
\r\n\t
img2.postr = imgpostr1;
\r\n\t
this.selectImgArr = new Array();
\r\n\t
this.movesteps += 1;
\r\n\t
if (this.nselectimg) {
\r\n\t
this.blockcont.removeChild(this.nselectimg);
\r\n\t
}
\r\n\t
var isuc = this.checkSuccess();
\r\n\t
if (isuc) {
\r\n\t
console.error(
\"
成功过关
\"
);
\r\n\t
this.gameover(1);
\r\n\t
}
\r\n\t
};
\r\n\t
GameView.prototype.checkSuccess = function () {
\r\n\t
var isuc = true;
\r\n\t
for (var r = 0; r < this.rows; r++) {
\r\n\t
for (var c = 0; c < this.cols; c++) {
\r\n\t
var ipicname =
\"
pic_
\"
+ c +
\"
_
\"
+ r;
\r\n\t
var npicstr = r +
\"
_
\"
+ c;
\r\n\t
var ipic = this.dicont.getChildByName(ipicname);
\r\n\t
var ipostr = ipic.postr;
\r\n\t
if (npicstr != ipostr) {
\r\n\t
isuc = false;
\r\n\t
break;
\r\n\t
}
\r\n\t
}
\r\n\t
}
\r\n\t
return isuc;
\r\n\t
};
\r\n\t
GameView.prototype.gameover = function (reason) {
\r\n\t
this.ingame = false;
\r\n\t
this.ticker && clearInterval(this.ticker);
\r\n\t
var ntime = Date.now();
\r\n\t
var gametime = ntime - this.startime;
\r\n\t
engine.globalEvent.dispatchEvent('pictures-game-over', {
\r\n\t
reason: reason,
\r\n\t
time: this.passtime,
\r\n\t
number: this.movesteps,
\r\n\t
gametime: gametime
\r\n\t
});
\r\n\t
};
\r\n\t
return GameView;
\r\n\t
}(engine.Container));
\n\n\t
var GameWrapper = (function (_super) {
\r\n\t
tslib.__extends(GameWrapper, _super);
\r\n\t
function GameWrapper() {
\r\n\t
var _this = _super.call(this) || this;
\r\n\t
_this._gameView = new GameView();
\r\n\t
_this.addChild(_this._gameView);
\r\n\t
engine.globalEvent.addEventListener('pictures-initgame', _this.initgame, _this);
\r\n\t
engine.globalEvent.addEventListener('pictures-start', _this.start, _this);
\r\n\t
engine.globalEvent.addEventListener('pictures-luanxu', _this.luanxu, _this);
\r\n\t
engine.globalEvent.addEventListener('pictures-pause', _this.pause, _this);
\r\n\t
engine.globalEvent.addEventListener('pictures-resume', _this.resume, _this);
\r\n\t
return _this;
\r\n\t
}
\r\n\t
GameWrapper.prototype.initgame = function (event) {
\r\n\t
injectProps(event.data);
\r\n\t
this._gameView.initgame();
\r\n\t
};
\r\n\t
GameWrapper.prototype.start = function (event) {
\r\n\t
injectProps(event.data);
\r\n\t
this._gameView.start();
\r\n\t
};
\r\n\t
GameWrapper.prototype.luanxu = function () {
\r\n\t
this._gameView.luanxu();
\r\n\t
};
\r\n\t
GameWrapper.prototype.pause = function (event) {
\r\n\t
this._gameView.pause();
\r\n\t
};
\r\n\t
GameWrapper.prototype.resume = function (event) {
\r\n\t
this._gameView.resume();
\r\n\t
};
\r\n\t
return GameWrapper;
\r\n\t
}(engine.Container));
\r\n\t
//# sourceMappingURL=GameWrapper.js.map
\n\n\t
function index (props) {
\r\n\t
prepareProps();
\r\n\t
injectProps(props);
\r\n\t
var instance = new GameWrapper();
\r\n\t
return instance;
\r\n\t
}
\r\n\t
//# sourceMappingURL=index.js.map
\n\n\t
return index;
\n\n
})));
\n
"
}
src/custom/pintu/debug/app.js
View file @
e4229d77
...
...
@@ -48,9 +48,14 @@ function launchWithCustomModule(customModule) {
setTimeout
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'pictures-initgame'
,
{
gameUrls
:[
"https://yun.duiba.com.cn/aurora/assets/
7a9960acd582bb0b41bcfcdb24da68f354ccb1ff
.jpg"
,
"https://yun.duiba.com.cn/aurora/assets/
5906e5670cb7061dfc77306087e9a79d4bbcb250
.jpg"
,
"https://yun.duiba.com.cn/aurora/assets/61fd0754d7924305fd2851be86a480d71d2c2981.jpg"
,
"https://yun.duiba.com.cn/aurora/assets/6b70d7ec626f35f21347bf5bc3e61bedc44167be.jpg"
],
gameTimes
:[
10000
,
10000
,
10000
,
]
})
},
1000
);
...
...
src/custom/pintu/debug/main.js
View file @
e4229d77
...
...
@@ -39,14 +39,13 @@
//# sourceMappingURL=utils.js.map
var
qietu
=
(
function
(
url
,
type1
,
rows
,
cols
,
parent
)
{
return
tslib
.
__awaiter
(
void
0
,
void
0
,
void
0
,
function
()
{
var
t
,
setimgwid
,
mwid1
,
mhei1
,
mwid
,
mhei
,
picarr
,
picnames
,
chax
,
chay
,
startlix
,
addlix
,
startliy
,
addliy
,
t
xt1
,
r
,
startx
,
endx
,
c
,
starty
,
endy
,
uvs
,
isprite
,
ispritename
,
e_1
;
var
t
,
setimgwid
,
mwid1
,
mhei1
,
mwid
,
mhei
,
picarr
,
picnames
,
chax
,
chay
,
startlix
,
addlix
,
startliy
,
addliy
,
t
wid1
,
thei1
,
r
,
startx
,
c
,
starty
,
nsprite
,
isprite
,
nsp
,
ispritename
,
e_1
;
return
tslib
.
__generator
(
this
,
function
(
_a
)
{
switch
(
_a
.
label
)
{
case
0
:
_a
.
trys
.
push
([
0
,
6
,
,
7
]);
t
=
void
0
;
if
(
!
(
type1
==
1
))
return
[
3
,
1
];
console
.
log
(
"直接使用已加载的tex"
);
t
=
url
;
return
[
3
,
3
];
case
1
:
return
[
4
,
loadImageByUrl
(
url
)];
...
...
@@ -60,7 +59,6 @@
mwid
=
t
.
width
;
mhei
=
t
.
height
;
if
(
!
(
mwid
<
10
||
mhei
<
10
))
return
[
3
,
5
];
console
.
log
(
"调整222222222222"
);
return
[
4
,
new
Promise
(
function
(
res
)
{
setTimeout
(
function
()
{
res
();
...
...
@@ -68,10 +66,8 @@
})];
case
4
:
_a
.
sent
();
return
[
2
,
qietu
(
t
,
1
,
rows
,
cols
,
parent
)];
return
[
2
,
qietu
(
t
,
1
,
rows
,
cols
)];
case
5
:
console
.
log
(
'图片'
,
t
);
console
.
log
(
"图片获取尺寸"
,
mwid
,
mhei
);
if
(
mwid
>
mhei
)
{
if
(
mhei
<
setimgwid
)
{
mwid
=
mwid
*
setimgwid
/
mhei
;
...
...
@@ -84,7 +80,6 @@
mwid
=
setimgwid
;
}
}
console
.
log
(
"适配后的图片尺寸"
,
mwid
,
mhei
);
picarr
=
{};
picnames
=
[];
chax
=
void
0
;
...
...
@@ -93,12 +88,16 @@
addlix
=
void
0
;
startliy
=
void
0
;
addliy
=
void
0
;
twid1
=
void
0
;
thei1
=
void
0
;
if
(
mwid
>
mhei
)
{
chax
=
(
mwid
-
mhei
)
/
2
;
startlix
=
chax
/
mwid
;
addlix
=
(
mhei
/
cols
)
/
mwid
;
startliy
=
0
;
addliy
=
1
/
rows
;
twid1
=
mwid
*
setimgwid
/
mhei
;
thei1
=
setimgwid
;
}
else
{
startlix
=
0
;
...
...
@@ -106,37 +105,31 @@
chay
=
(
mhei
-
mwid
)
/
2
;
startliy
=
chay
/
mhei
;
addliy
=
(
mwid
/
rows
)
/
mhei
;
thei1
=
mhei
*
setimgwid
/
mwid
;
twid1
=
setimgwid
;
}
console
.
log
(
"切图准备"
,
startlix
,
addlix
,
startliy
,
addliy
,
mwid
,
mhei
);
txt1
=
new
engine
.
Label
();
txt1
.
fillColor
=
"red"
;
txt1
.
size
=
24
;
txt1
.
text
=
startlix
.
toFixed
(
2
)
+
";"
+
addlix
.
toFixed
(
2
)
+
";"
+
startliy
.
toFixed
(
2
)
+
";"
+
addliy
.
toFixed
(
2
)
+
";"
+
mwid
.
toFixed
(
2
)
+
";"
+
mhei
.
toFixed
(
2
)
+
";"
;
parent
.
addChild
(
txt1
);
txt1
.
y
=
-
100
;
for
(
r
=
0
;
r
<
rows
;
r
++
)
{
startx
=
startlix
+
addlix
*
r
;
endx
=
startx
+
addlix
;
for
(
c
=
0
;
c
<
cols
;
c
++
)
{
starty
=
startliy
+
addliy
*
c
;
endy
=
starty
+
addliy
;
uvs
=
new
Float32Array
([
starty
,
startx
,
endy
,
startx
,
endy
,
endx
,
starty
,
endx
]);
isprite
=
new
engine
.
Sprite
(
t
);
isprite
.
uvs
=
uvs
;
nsprite
=
new
engine
.
Container
();
isprite
=
new
engine
.
ScrollView
();
nsp
=
new
engine
.
Sprite
(
t
);
isprite
.
addChild
(
nsp
);
nsp
.
width
=
twid1
;
nsp
.
height
=
thei1
;
isprite
.
mouseEnabled
=
false
;
isprite
.
mouseChildren
=
false
;
nsp
.
x
=
-
starty
*
twid1
;
nsp
.
y
=
-
startx
*
thei1
;
isprite
.
width
=
mwid1
;
isprite
.
height
=
mhei1
;
nsprite
.
addChild
(
isprite
);
nsprite
.
width
=
mwid1
;
nsprite
.
height
=
mhei1
;
ispritename
=
"pic_"
+
c
+
"_"
+
r
;
i
sprite
.
name
=
ispritename
;
picarr
[
ispritename
]
=
i
sprite
;
n
sprite
.
name
=
ispritename
;
picarr
[
ispritename
]
=
n
sprite
;
picnames
.
push
(
ispritename
);
}
}
...
...
@@ -149,8 +142,6 @@
}];
case
6
:
e_1
=
_a
.
sent
();
console
.
error
(
"图片加载失败"
,
e_1
);
console
.
log
(
url
,
rows
,
cols
);
return
[
2
,
{
res
:
false
}];
...
...
@@ -158,6 +149,7 @@
}
});
});
});
//# sourceMappingURL=qietu.js.map
var
GameView
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameView
,
_super
);
...
...
@@ -331,7 +323,6 @@
engine
.
globalEvent
.
dispatchEvent
(
"pictures-time-passtime"
,
{
passtime
:
this
.
passtime
});
console
.
log
(
"start-----------------"
,
actidx
);
this
.
rows
=
props
.
rows
;
this
.
cols
=
props
.
cols
;
this
.
nselectimg
=
null
;
...
...
@@ -549,7 +540,6 @@
};
return
GameView
;
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
...
...
src/custom/pintu/debug/main.js.map
View file @
e4229d77
{
"version"
:
3
,
"file"
:
"index.js"
,
"sources"
:
[
"src/custom/pintu/src/props.ts"
,
"src/custom/pintu/src/game/utils.ts"
,
"src/custom/pintu/src/game/qietu.ts"
,
"src/custom/pintu/src/game/GameView.ts"
,
"src/custom/pintu/src/game/GameWrapper.ts"
,
"src/custom/pintu/src/index.ts"
],
"sourcesContent"
:
[
"/**
\r\n
* Created by rockyl on 2020-01-21.
\r\n
*/
\r\n\r\n
export let props: any = {};
\r\n\r\n
export function prepareProps() {\r
\n\t
let metaProps = getProps();
\r\n\r\n\t
engine.injectProp(props, metaProps);
\r\n
}
\r\n\r\n
export function injectProps(p) {\r
\n\t
engine.injectProp(props, p);
\r\n
}
\r\n
"
,
"/**
\r\n
* Created by rockyl on 2020-01-21.
\r\n
*/
\r\n\r\n
export function getTexture(uuid) {\r
\n\t
return engine.Texture.from(getAssetByUUID(uuid).uuid);
\r\n
}
\r\n\r\n
export function getTextureByName(name) {\r
\n\t
return getTexture(engine.getAssetByName(name).uuid);
\r\n
}
\r\n\r\n
export function playSound(name) {\r
\n\t
engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
\r\n
}
\r\n
export function createSvga(name, anchorName?) {\r
\n\t
let inst = new svga.Svga();
\r\n\t
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
\r\n\t
return inst;
\r\n
}
\r\n\r\n
export async function loadImageByUrl(url){\r
\n\t
console.log('loadImageByUrl----------:',url);
\r\n\t
return new Promise((resolve) => {\r
\n\t\t
if (engine.TextureCache[url])
{
\r\n\t\t\tresolve(engine.TextureCache[url])\r\n\t\t
}
else {\r
\n\t\t\t
var t = engine.Texture.from(url);
\r\n\t\t\t
t.addEventListener(
\"
loaded
\"
, () => { resolve(t) })
\r\n\t\t
}
\r\n\t
})
\r\n
}"
,
"import { props } from
\"
../props
\"
;
\r\n
import { loadImageByUrl } from
\"
./utils
\"
;
\r\n
import qietu from
\"
./qietu
\"
;
\r\n
const urls = [];
\r\n
const picMap = {};
\r\n
const posMap = {};
\r\n
export default async(url:any,type1:number, rows:number, cols:number,parent:engine.Container) => {\r
\n
try{\r
\n
let t:engine.Texture;
\r\n
if(type1==1){\r
\n
console.log(
\"
直接使用已加载的tex
\"
);
\r\n
t = url;
\r\n
}else{\r
\n
t = await loadImageByUrl(url) as engine.Texture;
\r\n
}
\r\n
\r\n
let setimgwid = 612;
\r\n
let mwid1 = setimgwid/rows;
\r\n
let mhei1 = setimgwid/cols;
\r\n\r\n
let mwid = t.width;
\r\n
let mhei = t.height;
\r\n
if(mwid<10||mhei<10){\r
\n
console.log(
\"
调整222222222222
\"
);
\r\n
await new Promise(res=>{\r
\n
setTimeout(function(){\r
\n
res();
\r\n
},200);
\r\n
})
\r\n
return qietu(t,1,rows,cols,parent);
\r\n
}
\r\n
console.log('图片',t);
\r\n
console.log(
\"
图片获取尺寸
\"
,mwid,mhei);
\r\n
if(mwid>mhei){\r
\n
if(mhei<setimgwid){\r
\n
mwid = mwid*setimgwid/mhei;
\r\n
mhei = setimgwid;
\r\n
}
\r\n
}else{\r
\n
if(mwid<setimgwid){\r
\n
mhei = mhei*setimgwid/mwid;
\r\n
mwid = setimgwid;
\r\n
}
\r\n
}
\r\n
console.log(
\"
适配后的图片尺寸
\"
,mwid,mhei);
\r\n\r\n
let picarr = {};
\r\n
let picnames = [];
\r\n\r\n
let chax;
\r\n
let chay;
\r\n
let startlix;
\r\n
let addlix;
\r\n
let startliy;
\r\n
let addliy;
\r\n
if(mwid>mhei){\r
\n
chax = (mwid-mhei)/2;
\r\n
startlix = chax/mwid;
\r\n
addlix = (mhei/cols)/mwid;
\r\n\r\n
startliy = 0;
\r\n
addliy = 1/rows;
\r\n
}else{\r
\n
startlix = 0;
\r\n
addlix = 1/cols;
\r\n\r\n
chay = (mhei-mwid)/2;
\r\n
startliy = chay/mhei;
\r\n
addliy = (mwid/rows)/mhei;
\r\n
}
\r\n
\r\n
console.log(
\"
切图准备
\"
,startlix,addlix,startliy,addliy,mwid,mhei);
\r\n
let txt1 = new engine.Label();
\r\n
txt1.fillColor =
\"
red
\"
;
\r\n
txt1.size = 24;
\r\n
txt1.text = startlix.toFixed(2)+
\"
;
\"
+addlix.toFixed(2)+
\"
;
\"
+startliy.toFixed(2)+
\"
;
\"
+addliy.toFixed(2)+
\"
;
\"
+mwid.toFixed(2)+
\"
;
\"
+mhei.toFixed(2)+
\"
;
\"\r\n
parent.addChild(txt1);
\r\n
txt1.y = -100;
\r\n
for(let r=0;r<rows;r++){\r
\n
let startx = startlix+addlix*r;
\r\n
let endx = startx + addlix;
\r\n
for(let c=0;c<cols;c++){\r
\n
let starty = startliy+addliy*c;
\r\n
let endy = starty+addliy;
\r\n\r\n
let uvs = new Float32Array([
\r\n
starty,
\r\n
startx,
\r\n
endy,
\r\n
startx,
\r\n
endy,
\r\n
endx,
\r\n
starty,
\r\n
endx
\r\n
])
\r\n
let isprite = new engine.Sprite(t);
\r\n
\r\n
isprite.uvs = uvs;
\r\n\r\n
isprite.width = mwid1;
\r\n
isprite.height = mhei1;
\r\n\r\n
let ispritename =
\"
pic_
\"
+c+
\"
_
\"
+r;
\r\n
isprite.name = ispritename;
\r\n
picarr[ispritename] = isprite;
\r\n
picnames.push(ispritename);
\r\n
}
\r\n
}
\r\n
return {\r
\n
res:true,
\r\n
picarr:picarr,
\r\n
mwid:mwid1,
\r\n
mhei:mhei1,
\r\n
picnames:picnames
\r\n
};
\r\n
}catch(e){\r
\n
console.error(
\"
图片加载失败
\"
,e);
\r\n
console.log(url,rows,cols);
\r\n
return {\r
\n
res:false
\r\n
};
\r\n
}
\r\n
};
\r\n
"
,
"/**
\r\n
* Created by rockyl on 2018/8/16.
\r\n
*/
\r\n\r\n
import { props } from
\"
../props
\"
;
\r\n
import qietu from
\"
./qietu
\"
;
\r\n
import { getTexture, loadImageByUrl,getTextureByName } from
\"
./utils
\"
;
\r\n
import ObjectPool = engine.ObjectPool;
\r\n\r\n
export default class GameView extends engine.Container {\r
\n
rows:number;
\r\n
cols:number;
\r\n\r\n
passtime:number;
\r\n
gametime:number;
\r\n
showtime:number;
\r\n\r\n
lastframetime:number;
\r\n\r\n
ingame:boolean = false;
\r\n\r\n
ticker;
\r\n\r\n
selectimg3:engine.Image;
\r\n
selectimg4:engine.Image;
\r\n
nselectimg:engine.Image;
\r\n\r\n
selectImgArr:Array<string> = [];
\r\n
sucposData:Object = {};
\r\n\r\n
dicont:engine.Container;
\r\n
linecont:engine.Container;
\r\n
blockcont:engine.Container;
\r\n\r\n
lineShape:engine.Shape;
\r\n\r\n
mwid:number;
\r\n
mhei:number;
\r\n
picnames:Array<string>;
\r\n
picarr;
\r\n\r\n
gameUrls:Array<string> = [];
\r\n
gameTimes:Array<number> = [];
\r\n
onegamePics:Array<engine.Texture> = [];
\r\n
movesteps:number = 0;
\r\n
startime:number = 0;
\r\n
constructor() {\r
\n
super();
\r\n
this.once(engine.Event.ADDED_TO_STAGE, this.initScene, this);
\r\n
}
\r\n
initScene(){\r
\n
this.lineShape = new engine.Shape();
\r\n
this.selectimg3 = new engine.Image(getTextureByName(
\"
框3
\"
));
\r\n
this.selectimg4 = new engine.Image(getTextureByName(
\"
框4
\"
));
\r\n
this.selectimg3.mouseEnabled = false;
\r\n
this.selectimg4.mouseEnabled = false;
\r\n
//底图
\r\n
this.dicont = new engine.Container();
\r\n
//线
\r\n
this.linecont = new engine.Container();
\r\n
//亮片
\r\n
this.blockcont = new engine.Container();
\r\n\r\n
this.addChild(this.dicont);
\r\n
this.addChild(this.linecont);
\r\n
this.addChild(this.blockcont);
\r\n
\r\n
this.linecont.addChild(this.lineShape);
\r\n\r\n
console.log(
\"
拼图初始化完毕--------------
\"
);
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-initcomp
\"
,{});
\r\n
this.removeEventListener(engine.Event.ADDED_TO_STAGE,this.initScene,this);
\r\n
}
\r\n
async initgame(){\r
\n
console.log(
\"
initgame---------
\"
);
\r\n
this.gameUrls = props.gameUrls;
\r\n
this.gameTimes = props.gameTimes;
\r\n
\r\n
this.onegamePics = new Array();
\r\n
for(let l=0;l<this.gameUrls.length;l++){\r
\n
let lurl = this.gameUrls[l];
\r\n
let lt = await loadImageByUrl(lurl) as engine.Texture;
\r\n
this.onegamePics.push(lt);
\r\n
if(this.onegamePics.length==1){//第一张图加载完毕,自动填充
\r\n
this.startfirst();
\r\n\r\n
}
\r\n
}
\r\n
}
\r\n
async startfirst(){\r
\n
this.dicont.removeChildren();
\r\n
this.movesteps = 0;
\r\n
this.startime = Date.now();
\r\n\r\n
let actidx = 0;
\r\n
this.gametime = this.gameTimes[actidx];
\r\n
this.showtime = this.gameTimes[actidx];
\r\n
this.passtime = 0;
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
,{\r
\n
time:this.showtime,
\r\n
});
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
,{\r
\n
passtime:this.passtime
\r\n
});
\r\n
console.log(
\"
start-----------------
\"
,actidx);
\r\n
this.rows = 3;
\r\n
this.cols = 3;
\r\n\r\n
this.nselectimg = null;
\r\n
if(this.rows==3){\r
\n
this.nselectimg = this.selectimg3;
\r\n
}
\r\n
if(this.rows==4){\r
\n
this.nselectimg = this.selectimg4;
\r\n
}
\r\n\r\n
\r\n
\r\n
this.selectImgArr = new Array();
\r\n
this.sucposData = {};
\r\n\r\n
let tex:any = this.onegamePics[actidx];
\r\n
let type1 = 1;
\r\n
if(!tex){\r
\n
tex = this.gameUrls[actidx];
\r\n
type1 = 2;
\r\n
}
\r\n
let result = await qietu(tex,type1,this.rows,this.cols,this.dicont);
\r\n
let res = result.res;
\r\n
if(res){\r
\n
let picarr = result.picarr;
\r\n
let mwid = result.mwid;
\r\n
let mhei = result.mhei;
\r\n
let picnames = result.picnames;
\r\n\r\n
this.mwid = mwid;
\r\n
this.mhei = mhei;
\r\n
this.picarr = picarr;
\r\n
this.picnames = picnames;
\r\n\r\n
let gap = 2;
\r\n
for(let r=0;r<this.rows;r++){\r
\n
for(let c=0;c<this.cols;c++){\r
\n
let ipicx = mwid*c+gap;
\r\n
let ipicy = mhei*r+gap;
\r\n
let npicname =
\"
pic_
\"
+c+
\"
_
\"
+r;
\r\n
let ipic = picarr[npicname];
\r\n
this.dicont.addChild(ipic);
\r\n
ipic.x = ipicx;
\r\n
ipic.y = ipicy;
\r\n
}
\r\n
}
\r\n
//框线
\r\n
this.lineShape.clear();
\r\n
this.lineShape.beginStroke(0x0069df,4,engine.LINE_CAP.BUTT,engine.LINE_JOIN.BEVEL,100);
\r\n\r\n
this.lineShape.moveTo(0+gap,0+gap);
\r\n
this.lineShape.lineTo(mhei*this.cols+gap,0+gap);
\r\n
this.lineShape.lineTo(mhei*this.cols+gap,mwid*this.rows+gap);
\r\n
this.lineShape.lineTo(0+gap,mwid*this.rows+gap);
\r\n
this.lineShape.lineTo(0+gap,0+gap);
\r\n\r\n
for(let rl=1;rl<this.rows;rl++){\r
\n
this.lineShape.moveTo(0+gap,rl*mhei+gap);
\r\n
this.lineShape.lineTo(mwid*this.cols+gap,rl*mhei+gap);
\r\n
}
\r\n
for(let cl=1;cl<this.cols;cl++){\r
\n
this.lineShape.moveTo(cl*mwid+gap,0+gap);
\r\n
this.lineShape.lineTo(cl*mwid+gap,this.rows*mhei+gap);
\r\n
}
\r\n
this.lineShape.endStroke();
\r\n
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-load-complete
\"
);
\r\n
this.ticker&&clearInterval(this.ticker);
\r\n
this.ticker = setInterval(this.update, 10);
\r\n
}else{\r
\n
console.error(
\"
图片处理失败
\"
);
\r\n
}
\r\n
}
\r\n
async start() {\r
\n
\r\n
this.dicont.removeChildren();
\r\n
this.movesteps = 0;
\r\n
this.startime = Date.now();
\r\n\r\n
let actidx = props.actidx;
\r\n
this.gametime = this.gameTimes[actidx];
\r\n
this.showtime = this.gameTimes[actidx];
\r\n
this.passtime = 0;
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
,{\r
\n
time:this.showtime,
\r\n
});
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
,{\r
\n
passtime:this.passtime
\r\n
});
\r\n
console.log(
\"
start-----------------
\"
,actidx);
\r\n
this.rows = props.rows;
\r\n
this.cols = props.cols;
\r\n\r\n
this.nselectimg = null;
\r\n
if(this.rows==3){\r
\n
this.nselectimg = this.selectimg3;
\r\n
}
\r\n
if(this.rows==4){\r
\n
this.nselectimg = this.selectimg4;
\r\n
}
\r\n\r\n
\r\n
\r\n
this.selectImgArr = new Array();
\r\n
this.sucposData = {};
\r\n\r\n
let tex:any = this.onegamePics[actidx];
\r\n
let type1 = 1;
\r\n
if(!tex){\r
\n
tex = this.gameUrls[actidx];
\r\n
type1 = 2;
\r\n
}
\r\n
let result = await qietu(tex,type1,this.rows,this.cols,this.dicont);
\r\n
let res = result.res;
\r\n
if(res){\r
\n
let picarr = result.picarr;
\r\n
let mwid = result.mwid;
\r\n
let mhei = result.mhei;
\r\n
let picnames = result.picnames;
\r\n\r\n
this.mwid = mwid;
\r\n
this.mhei = mhei;
\r\n
this.picarr = picarr;
\r\n
this.picnames = picnames;
\r\n\r\n
let gap = 2;
\r\n
for(let r=0;r<this.rows;r++){\r
\n
for(let c=0;c<this.cols;c++){\r
\n
let ipicx = mwid*c+gap;
\r\n
let ipicy = mhei*r+gap;
\r\n
let npicname =
\"
pic_
\"
+c+
\"
_
\"
+r;
\r\n\r\n
// this.sucposData[npicname] = r+
\"
_
\"
+c;
\r\n\r\n
// let selidx = Math.floor(Math.random()*picnames.length);
\r\n
// let ipicname:string = picnames[selidx];
\r\n
// if(r==c&&r!=this.rows-1){\r
\n
// while(ipicname==npicname){\r
\n
// selidx = Math.floor(Math.random()*picnames.length);
\r\n
// ipicname = picnames[selidx];
\r\n
// }
\r\n
// }
\r\n
let ipic = picarr[npicname];
\r\n
// picnames.splice(selidx,1);
\r\n
this.dicont.addChild(ipic);
\r\n
ipic.x = ipicx;
\r\n
ipic.y = ipicy;
\r\n
// ipic[
\"
postr
\"
] = r+
\"
_
\"
+c;
\r\n\r\n
// ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN,
\r\n
// this.touchPic,this);
\r\n
}
\r\n
}
\r\n
//框线
\r\n
this.lineShape.clear();
\r\n
this.lineShape.beginStroke(0x0069df,4,engine.LINE_CAP.BUTT,engine.LINE_JOIN.BEVEL,100);
\r\n\r\n
this.lineShape.moveTo(0+gap,0+gap);
\r\n
this.lineShape.lineTo(mhei*this.cols+gap,0+gap);
\r\n
this.lineShape.lineTo(mhei*this.cols+gap,mwid*this.rows+gap);
\r\n
this.lineShape.lineTo(0+gap,mwid*this.rows+gap);
\r\n
this.lineShape.lineTo(0+gap,0+gap);
\r\n\r\n
for(let rl=1;rl<this.rows;rl++){\r
\n
this.lineShape.moveTo(0+gap,rl*mhei+gap);
\r\n
this.lineShape.lineTo(mwid*this.cols+gap,rl*mhei+gap);
\r\n
}
\r\n
for(let cl=1;cl<this.cols;cl++){\r
\n
this.lineShape.moveTo(cl*mwid+gap,0+gap);
\r\n
this.lineShape.lineTo(cl*mwid+gap,this.rows*mhei+gap);
\r\n
}
\r\n
this.lineShape.endStroke();
\r\n
\r\n
this.ticker&&clearInterval(this.ticker);
\r\n
this.ticker = setInterval(this.update, 10);
\r\n
}else{\r
\n
console.error(
\"
图片处理失败
\"
);
\r\n
}
\r\n
}
\r\n
luanxu(){\r
\n
let gap = 2;
\r\n
for(let r=0;r<this.rows;r++){\r
\n
for(let c=0;c<this.cols;c++){\r
\n
let ipicx = this.mwid*c+gap;
\r\n
let ipicy = this.mhei*r+gap;
\r\n
let npicname =
\"
pic_
\"
+c+
\"
_
\"
+r;
\r\n\r\n
this.sucposData[npicname] = r+
\"
_
\"
+c;
\r\n\r\n
let selidx = Math.floor(Math.random()*this.picnames.length);
\r\n
let ipicname:string = this.picnames[selidx];
\r\n
if(r==c&&r!=this.rows-1){\r
\n
while(ipicname==npicname){\r
\n
selidx = Math.floor(Math.random()*this.picnames.length);
\r\n
ipicname = this.picnames[selidx];
\r\n
}
\r\n
}
\r\n
let ipic = this.picarr[ipicname];
\r\n
this.picnames.splice(selidx,1);
\r\n
ipic.x = ipicx;
\r\n
ipic.y = ipicy;
\r\n
ipic[
\"
postr
\"
] = r+
\"
_
\"
+c;
\r\n\r\n
ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN,
\r\n
this.touchPic,this);
\r\n
}
\r\n
}
\r\n
}
\r\n
pause(){\r
\n
this.ingame = false;
\r\n
console.error(
\"
拼图暂停
\"
);
\r\n
}
\r\n
resume(){\r
\n
this.lastframetime = Date.now();
\r\n
this.ingame = true;
\r\n
console.error(
\"
拼图继续
\"
);
\r\n
}
\r\n\r\n\r\n
update() {\r
\n
let ntime = Date.now();
\r\n
if(!this.lastframetime){\r
\n
this.lastframetime = ntime;
\r\n
return;
\r\n
}
\r\n
if(this.ingame){\r
\n
let passtime = (ntime - this.lastframetime)/1000;
\r\n
this.passtime += passtime;
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
,{\r
\n
passtime:this.passtime
\r\n
});
\r\n
let showtime1 = Math.round(this.gametime - this.passtime);
\r\n
// console.log(passtime,this.passtime,this.gametime,this.showtime);
\r\n
if(this.showtime!=showtime1){\r
\n
this.showtime = showtime1;
\r\n
if(this.showtime<=0){\r
\n
this.showtime = 0;
\r\n
this.gameover(2);
\r\n
}
\r\n
// console.log(
\"
倒计时
\"
,this.showtime);
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
,{\r
\n
time:this.showtime
\r\n
});
\r\n
}
\r\n
}
\r\n
this.lastframetime = ntime;
\r\n
}
\r\n\r\n
touchPic(e:engine.MouseEvent){\r
\n
if(!this.ingame){\r
\n
return;
\r\n
}
\r\n
// console.log(e.target.name);
\r\n
let selectname = e.target.name;
\r\n
let spx = e.target.x;
\r\n
let spy = e.target.y;
\r\n
let gap = 2;
\r\n
if(this.selectImgArr.length==0){\r
\n
if(this.nselectimg){\r
\n
this.blockcont.addChild(this.nselectimg);
\r\n
this.nselectimg.x = spx-gap;
\r\n
this.nselectimg.y = spy-gap;
\r\n
}
\r\n
this.selectImgArr.push(selectname);
\r\n
}else if(this.selectImgArr.length==1){\r
\n
if(selectname==this.selectImgArr[0]){\r
\n
if(this.nselectimg){\r
\n
this.blockcont.removeChild(this.nselectimg);
\r\n
}
\r\n
this.selectImgArr = new Array();
\r\n
return;
\r\n
}else{\r
\n
this.selectImgArr.push(selectname);
\r\n
this.changeImgPos();
\r\n
}
\r\n
}
\r\n
}
\r\n
changeImgPos(){\r
\n
let img1name = this.selectImgArr[0];
\r\n
let img2name = this.selectImgArr[1];
\r\n\r\n
let img1 = this.dicont.getChildByName(img1name);
\r\n
let img2 = this.dicont.getChildByName(img2name);
\r\n\r\n
let imgpos1x = img1.x;
\r\n
let imgpos1y = img1.y;
\r\n
let imgpos2x = img2.x;
\r\n
let imgpos2y = img2.y;
\r\n\r\n
let imgpostr1 = img1.postr;
\r\n
let imgpostr2 = img2.postr;
\r\n\r\n
img1.x = imgpos2x;
\r\n
img1.y = imgpos2y;
\r\n
img1.postr = imgpostr2;
\r\n\r\n
img2.x = imgpos1x;
\r\n
img2.y = imgpos1y;
\r\n
img2.postr = imgpostr1;
\r\n\r\n
this.selectImgArr = new Array();
\r\n
\r\n
this.movesteps += 1;
\r\n\r\n
if(this.nselectimg){\r
\n
this.blockcont.removeChild(this.nselectimg);
\r\n
}
\r\n
let isuc = this.checkSuccess();
\r\n
if(isuc){\r
\n
console.error(
\"
成功过关
\"
);
\r\n
this.gameover(1);
\r\n
}
\r\n
}
\r\n
checkSuccess(){\r
\n
let isuc:boolean = true;
\r\n
for(let r=0;r<this.rows;r++){\r
\n
for(let c=0;c<this.cols;c++){\r
\n
let ipicname =
\"
pic_
\"
+c+
\"
_
\"
+r;
\r\n
let npicstr = r+
\"
_
\"
+c;
\r\n
let ipic = this.dicont.getChildByName(ipicname);
\r\n
let ipostr = ipic.postr;
\r\n
if(npicstr!=ipostr){\r
\n
isuc = false;
\r\n
break;
\r\n
}
\r\n
}
\r\n
}
\r\n\r\n
return isuc;
\r\n\r\n
}
\r\n
/**
\r\n
*
\r\n
* @param reason 1成功,2失败
\r\n
*/
\r\n
private gameover(reason:number) {\r
\n
this.ingame = false;
\r\n
this.ticker&&clearInterval(this.ticker);
\r\n\r\n
let ntime = Date.now();
\r\n
let gametime = ntime - this.startime;
\r\n
engine.globalEvent.dispatchEvent('pictures-game-over', {\r
\n
reason:reason,
\r\n
time: this.passtime,
\r\n
number:this.movesteps,
\r\n
gametime:gametime
\r\n
});
\r\n
}
\r\n\r\n
}
\r\n
"
,
"/**
\r\n
* Created by rockyl on 2020-01-09.
\r\n
*/
\r\n\r\n
import GameView from
\"
./GameView
\"
;
\r\n
import { injectProps } from
\"
../props
\"
;
\r\n\r\n\r\n
export class GameWrapper extends engine.Container {\r
\n\t
// private _status;
\r\n\t
private _gameView: GameView;
\r\n\r\n\r\n\r\n\r\n\r\n\t
constructor() {\r
\n\t\t
super();
\r\n\r\n\t\t
//创建实例
\r\n\t\t
this._gameView = new GameView();
\r\n\t\t
this.addChild(this._gameView);
\r\n\r\n\t\t
engine.globalEvent.addEventListener('pictures-initgame', this.initgame, this);
\r\n\t\t
engine.globalEvent.addEventListener('pictures-start', this.start, this);
\r\n\t\t
engine.globalEvent.addEventListener('pictures-luanxu', this.luanxu, this);
\r\n\t\t
engine.globalEvent.addEventListener('pictures-pause', this.pause, this);
\r\n\t\t
engine.globalEvent.addEventListener('pictures-resume', this.resume, this);
\r\n\t
}
\r\n\t
initgame(event: engine.Event) {\r
\n\t\t
injectProps(event.data);
\r\n\r\n\t\t
// this._status = 1;
\r\n\r\n\t\t
this._gameView.initgame();
\r\n\t
}
\r\n\t
start(event: engine.Event) {\r
\n\t\t
injectProps(event.data);
\r\n\r\n\t\t
// this._status = 1;
\r\n\r\n\t\t
this._gameView.start();
\r\n\t
}
\r\n\t
luanxu()
{
\r\n\t\tthis._gameView.luanxu();\r\n\t
}
\r\n\t
pause(event: engine.Event)
{
\r\n\t\t\r\n\t\tthis._gameView.pause();\r\n\t}\r\n\tresume(event:engine.Event){\r\n\t\tthis._gameView.resume();\r\n\t}\r\n
}
\r\n
"
,
"/**
\r\n
* Created by rockyl on 2019-11-20.
\r\n
*/
\r\n\r\n
import
{
GameWrapper
}
from
\"
./game/GameWrapper
\"
;
\r\n
import {injectProps, prepareProps} from
\"
./props
\"
;
\r\n\r\n
export default function (props) {\r
\n\t
prepareProps();
\r\n\t
injectProps(props);
\r\n\r\n\t
let instance = new GameWrapper();
\r\n\t\r\n\t
return instance;
\r\n
}
\r\n
"
],
"names"
:
[
"__extends"
],
"mappings"
:
";;;;;;CAIO,IAAI,KAAK,GAAQ,EAAE,CAAC;AAE3B,UAAgB,YAAY;KAC3B,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;KAE3B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CACrC,CAAC;AAED,UAAgB,WAAW,CAAC,CAAC;KAC5B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAC7B,CAAC;;;UCVe,UAAU,CAAC,IAAI;KAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC;AAED,UAAgB,gBAAgB,CAAC,IAAI;KACpC,OAAO,UAAU,CAAC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AK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KAEjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"
}
\ No newline at end of file
{
"version"
:
3
,
"file"
:
"index.js"
,
"sources"
:
[
"src/custom/pintu/src/props.ts"
,
"src/custom/pintu/src/game/utils.ts"
,
"src/custom/pintu/src/game/qietu.ts"
,
"src/custom/pintu/src/game/GameView.ts"
,
"src/custom/pintu/src/game/GameWrapper.ts"
,
"src/custom/pintu/src/index.ts"
],
"sourcesContent"
:
[
"/**
\r\n
* Created by rockyl on 2020-01-21.
\r\n
*/
\r\n\r\n
export let props: any = {};
\r\n\r\n
export function prepareProps() {\r
\n\t
let metaProps = getProps();
\r\n\r\n\t
engine.injectProp(props, metaProps);
\r\n
}
\r\n\r\n
export function injectProps(p) {\r
\n\t
engine.injectProp(props, p);
\r\n
}
\r\n
"
,
"/**
\r\n
* Created by rockyl on 2020-01-21.
\r\n
*/
\r\n\r\n
export function getTexture(uuid) {\r
\n\t
return engine.Texture.from(getAssetByUUID(uuid).uuid);
\r\n
}
\r\n\r\n
export function getTextureByName(name) {\r
\n\t
return getTexture(engine.getAssetByName(name).uuid);
\r\n
}
\r\n\r\n
export function playSound(name) {\r
\n\t
engine.playSound(engine.getAssetByName(name).uuid, {keep: true});
\r\n
}
\r\n
export function createSvga(name, anchorName?) {\r
\n\t
let inst = new svga.Svga();
\r\n\t
inst.source = 'asset://' + engine.getAssetByName(name).uuid;
\r\n\t
return inst;
\r\n
}
\r\n\r\n
export async function loadImageByUrl(url){\r
\n\t
console.log('loadImageByUrl----------:',url);
\r\n\t
return new Promise((resolve) => {\r
\n\t\t
if (engine.TextureCache[url])
{
\r\n\t\t\tresolve(engine.TextureCache[url])\r\n\t\t
}
else {\r
\n\t\t\t
var t = engine.Texture.from(url);
\r\n\t\t\t
t.addEventListener(
\"
loaded
\"
, () => { resolve(t) })
\r\n\t\t
}
\r\n\t
})
\r\n
}"
,
"import { props } from
\"
../props
\"
;
\r\n
import { loadImageByUrl } from
\"
./utils
\"
;
\r\n
import qietu from
\"
./qietu
\"
;
\r\n
const urls = [];
\r\n
const picMap = {};
\r\n
const posMap = {};
\r\n
export default async(url:any,type1:number, rows:number, cols:number,parent:engine.Container) => {\r
\n
try{\r
\n
let t:engine.Texture;
\r\n
if(type1==1){\r
\n
t = url;
\r\n
}else{\r
\n
t = await loadImageByUrl(url) as engine.Texture;
\r\n
}
\r\n
\r\n
let setimgwid = 612;
\r\n
let mwid1 = setimgwid/rows;
\r\n
let mhei1 = setimgwid/cols;
\r\n\r\n
let mwid = t.width;
\r\n
let mhei = t.height;
\r\n
if(mwid<10||mhei<10){\r
\n
await new Promise(res=>{\r
\n
setTimeout(function(){\r
\n
res();
\r\n
},200);
\r\n
})
\r\n
return qietu(t,1,rows,cols,parent);
\r\n
}
\r\n
if(mwid>mhei){\r
\n
if(mhei<setimgwid){\r
\n
mwid = mwid*setimgwid/mhei;
\r\n
mhei = setimgwid;
\r\n
}
\r\n
}else{\r
\n
if(mwid<setimgwid){\r
\n
mhei = mhei*setimgwid/mwid;
\r\n
mwid = setimgwid;
\r\n
}
\r\n
}
\r\n\r\n
let picarr = {};
\r\n
let picnames = [];
\r\n\r\n
let chax;
\r\n
let chay;
\r\n
let startlix;
\r\n
let addlix;
\r\n
let startliy;
\r\n
let addliy;
\r\n\r\n
let twid1;
\r\n
let thei1;
\r\n
if(mwid>mhei){\r
\n
chax = (mwid-mhei)/2;
\r\n
startlix = chax/mwid;
\r\n
addlix = (mhei/cols)/mwid;
\r\n\r\n
startliy = 0;
\r\n
addliy = 1/rows;
\r\n\r\n
twid1 = mwid*setimgwid/mhei;
\r\n
thei1 = setimgwid;
\r\n
}else{\r
\n
startlix = 0;
\r\n
addlix = 1/cols;
\r\n\r\n
chay = (mhei-mwid)/2;
\r\n
startliy = chay/mhei;
\r\n
addliy = (mwid/rows)/mhei;
\r\n\r\n
thei1 = mhei*setimgwid/mwid;
\r\n
twid1 = setimgwid;
\r\n
}
\r\n
\r\n
// console.log(
\"
切图准备
\"
,startlix,addlix,startliy,addliy,mwid,mhei);
\r\n
// let txt1 = new engine.Label();
\r\n
// txt1.fillColor =
\"
red
\"
;
\r\n
// txt1.size = 24;
\r\n
// txt1.text = startlix.toFixed(2)+
\"
;
\"
+addlix.toFixed(2)+
\"
;
\"
+startliy.toFixed(2)+
\"
;
\"
+addliy.toFixed(2)+
\"
;
\"
+mwid.toFixed(2)+
\"
;
\"
+mhei.toFixed(2)+
\"
;
\"\r\n
// parent.addChild(txt1);
\r\n
// txt1.y = -100;
\r\n
for(let r=0;r<rows;r++){\r
\n
let startx = startlix+addlix*r;
\r\n
let endx = startx + addlix;
\r\n
for(let c=0;c<cols;c++){\r
\n
let starty = startliy+addliy*c;
\r\n
let endy = starty+addliy;
\r\n\r\n
let uvs = new Float32Array([
\r\n
starty,
\r\n
startx,
\r\n
endy,
\r\n
startx,
\r\n
endy,
\r\n
endx,
\r\n
starty,
\r\n
endx
\r\n
])
\r\n
// let isprite = new engine.Sprite(t);
\r\n
\r\n
// isprite.uvs = uvs;
\r\n
let nsprite = new engine.Container();
\r\n\r\n
let isprite = new engine.ScrollView();
\r\n
let nsp = new engine.Sprite(t);
\r\n
isprite.addChild(nsp);
\r\n
nsp.width = twid1;
\r\n
nsp.height = thei1;
\r\n\r\n
isprite.mouseEnabled = false;
\r\n
isprite.mouseChildren = false;
\r\n
nsp.x = -starty*twid1;
\r\n
nsp.y = -startx*thei1;
\r\n\r\n
isprite.width = mwid1;
\r\n
isprite.height = mhei1;
\r\n\r\n
nsprite.addChild(isprite);
\r\n
nsprite.width = mwid1;
\r\n
nsprite.height = mhei1;
\r\n\r\n
let ispritename =
\"
pic_
\"
+c+
\"
_
\"
+r;
\r\n
nsprite.name = ispritename;
\r\n
picarr[ispritename] = nsprite;
\r\n
picnames.push(ispritename);
\r\n
}
\r\n
}
\r\n
return {\r
\n
res:true,
\r\n
picarr:picarr,
\r\n
mwid:mwid1,
\r\n
mhei:mhei1,
\r\n
picnames:picnames
\r\n
};
\r\n
}catch(e){\r
\n
return {\r
\n
res:false
\r\n
};
\r\n
}
\r\n
};
\r\n
"
,
"/**
\r\n
* Created by rockyl on 2018/8/16.
\r\n
*/
\r\n\r\n
import { props } from
\"
../props
\"
;
\r\n
import qietu from
\"
./qietu
\"
;
\r\n
import { getTexture, loadImageByUrl,getTextureByName } from
\"
./utils
\"
;
\r\n
import ObjectPool = engine.ObjectPool;
\r\n\r\n
export default class GameView extends engine.Container {\r
\n
rows:number;
\r\n
cols:number;
\r\n\r\n
passtime:number;
\r\n
gametime:number;
\r\n
showtime:number;
\r\n\r\n
lastframetime:number;
\r\n\r\n
ingame:boolean = false;
\r\n\r\n
ticker;
\r\n\r\n
selectimg3:engine.Image;
\r\n
selectimg4:engine.Image;
\r\n
nselectimg:engine.Image;
\r\n\r\n
selectImgArr:Array<string> = [];
\r\n
sucposData:Object = {};
\r\n\r\n
dicont:engine.Container;
\r\n
linecont:engine.Container;
\r\n
blockcont:engine.Container;
\r\n\r\n
lineShape:engine.Shape;
\r\n\r\n
mwid:number;
\r\n
mhei:number;
\r\n
picnames:Array<string>;
\r\n
picarr;
\r\n\r\n
gameUrls:Array<string> = [];
\r\n
gameTimes:Array<number> = [];
\r\n
onegamePics:Array<engine.Texture> = [];
\r\n
movesteps:number = 0;
\r\n
startime:number = 0;
\r\n
constructor() {\r
\n
super();
\r\n
this.once(engine.Event.ADDED_TO_STAGE, this.initScene, this);
\r\n
}
\r\n
initScene(){\r
\n
this.lineShape = new engine.Shape();
\r\n
this.selectimg3 = new engine.Image(getTextureByName(
\"
框3
\"
));
\r\n
this.selectimg4 = new engine.Image(getTextureByName(
\"
框4
\"
));
\r\n
this.selectimg3.mouseEnabled = false;
\r\n
this.selectimg4.mouseEnabled = false;
\r\n
//底图
\r\n
this.dicont = new engine.Container();
\r\n
//线
\r\n
this.linecont = new engine.Container();
\r\n
//亮片
\r\n
this.blockcont = new engine.Container();
\r\n\r\n
this.addChild(this.dicont);
\r\n
this.addChild(this.linecont);
\r\n
this.addChild(this.blockcont);
\r\n
\r\n
this.linecont.addChild(this.lineShape);
\r\n\r\n
console.log(
\"
拼图初始化完毕--------------
\"
);
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-initcomp
\"
,{});
\r\n
this.removeEventListener(engine.Event.ADDED_TO_STAGE,this.initScene,this);
\r\n
}
\r\n
async initgame(){\r
\n
console.log(
\"
initgame---------
\"
);
\r\n
this.gameUrls = props.gameUrls;
\r\n
this.gameTimes = props.gameTimes;
\r\n
\r\n
this.onegamePics = new Array();
\r\n
for(let l=0;l<this.gameUrls.length;l++){\r
\n
let lurl = this.gameUrls[l];
\r\n
let lt = await loadImageByUrl(lurl) as engine.Texture;
\r\n
this.onegamePics.push(lt);
\r\n
if(this.onegamePics.length==1){//第一张图加载完毕,自动填充
\r\n
this.startfirst();
\r\n\r\n
}
\r\n
}
\r\n
}
\r\n
async startfirst(){\r
\n
this.dicont.removeChildren();
\r\n
this.movesteps = 0;
\r\n
this.startime = Date.now();
\r\n\r\n
let actidx = 0;
\r\n
this.gametime = this.gameTimes[actidx];
\r\n
this.showtime = this.gameTimes[actidx];
\r\n
this.passtime = 0;
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
,{\r
\n
time:this.showtime,
\r\n
});
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
,{\r
\n
passtime:this.passtime
\r\n
});
\r\n
console.log(
\"
start-----------------
\"
,actidx);
\r\n
this.rows = 3;
\r\n
this.cols = 3;
\r\n\r\n
this.nselectimg = null;
\r\n
if(this.rows==3){\r
\n
this.nselectimg = this.selectimg3;
\r\n
}
\r\n
if(this.rows==4){\r
\n
this.nselectimg = this.selectimg4;
\r\n
}
\r\n\r\n
\r\n
\r\n
this.selectImgArr = new Array();
\r\n
this.sucposData = {};
\r\n\r\n
let tex:any = this.onegamePics[actidx];
\r\n
let type1 = 1;
\r\n
if(!tex){\r
\n
tex = this.gameUrls[actidx];
\r\n
type1 = 2;
\r\n
}
\r\n
let result = await qietu(tex,type1,this.rows,this.cols,this.dicont);
\r\n
let res = result.res;
\r\n
if(res){\r
\n
let picarr = result.picarr;
\r\n
let mwid = result.mwid;
\r\n
let mhei = result.mhei;
\r\n
let picnames = result.picnames;
\r\n\r\n
this.mwid = mwid;
\r\n
this.mhei = mhei;
\r\n
this.picarr = picarr;
\r\n
this.picnames = picnames;
\r\n\r\n
let gap = 2;
\r\n
for(let r=0;r<this.rows;r++){\r
\n
for(let c=0;c<this.cols;c++){\r
\n
let ipicx = mwid*c+gap;
\r\n
let ipicy = mhei*r+gap;
\r\n
let npicname =
\"
pic_
\"
+c+
\"
_
\"
+r;
\r\n
let ipic = picarr[npicname];
\r\n
this.dicont.addChild(ipic);
\r\n
ipic.x = ipicx;
\r\n
ipic.y = ipicy;
\r\n
}
\r\n
}
\r\n
//框线
\r\n
this.lineShape.clear();
\r\n
this.lineShape.beginStroke(0x0069df,4,engine.LINE_CAP.BUTT,engine.LINE_JOIN.BEVEL,100);
\r\n\r\n
this.lineShape.moveTo(0+gap,0+gap);
\r\n
this.lineShape.lineTo(mhei*this.cols+gap,0+gap);
\r\n
this.lineShape.lineTo(mhei*this.cols+gap,mwid*this.rows+gap);
\r\n
this.lineShape.lineTo(0+gap,mwid*this.rows+gap);
\r\n
this.lineShape.lineTo(0+gap,0+gap);
\r\n\r\n
for(let rl=1;rl<this.rows;rl++){\r
\n
this.lineShape.moveTo(0+gap,rl*mhei+gap);
\r\n
this.lineShape.lineTo(mwid*this.cols+gap,rl*mhei+gap);
\r\n
}
\r\n
for(let cl=1;cl<this.cols;cl++){\r
\n
this.lineShape.moveTo(cl*mwid+gap,0+gap);
\r\n
this.lineShape.lineTo(cl*mwid+gap,this.rows*mhei+gap);
\r\n
}
\r\n
this.lineShape.endStroke();
\r\n
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-load-complete
\"
);
\r\n
this.ticker&&clearInterval(this.ticker);
\r\n
this.ticker = setInterval(this.update, 10);
\r\n
}else{\r
\n
console.error(
\"
图片处理失败
\"
);
\r\n
}
\r\n
}
\r\n
async start() {\r
\n
\r\n
this.dicont.removeChildren();
\r\n
this.movesteps = 0;
\r\n
this.startime = Date.now();
\r\n\r\n
let actidx = props.actidx;
\r\n
this.gametime = this.gameTimes[actidx];
\r\n
this.showtime = this.gameTimes[actidx];
\r\n
this.passtime = 0;
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
,{\r
\n
time:this.showtime,
\r\n
});
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
,{\r
\n
passtime:this.passtime
\r\n
});
\r\n
this.rows = props.rows;
\r\n
this.cols = props.cols;
\r\n\r\n
this.nselectimg = null;
\r\n
if(this.rows==3){\r
\n
this.nselectimg = this.selectimg3;
\r\n
}
\r\n
if(this.rows==4){\r
\n
this.nselectimg = this.selectimg4;
\r\n
}
\r\n\r\n
\r\n
\r\n
this.selectImgArr = new Array();
\r\n
this.sucposData = {};
\r\n\r\n
let tex:any = this.onegamePics[actidx];
\r\n
let type1 = 1;
\r\n
if(!tex){\r
\n
tex = this.gameUrls[actidx];
\r\n
type1 = 2;
\r\n
}
\r\n
let result = await qietu(tex,type1,this.rows,this.cols,this.dicont);
\r\n
let res = result.res;
\r\n
if(res){\r
\n
let picarr = result.picarr;
\r\n
let mwid = result.mwid;
\r\n
let mhei = result.mhei;
\r\n
let picnames = result.picnames;
\r\n\r\n
this.mwid = mwid;
\r\n
this.mhei = mhei;
\r\n
this.picarr = picarr;
\r\n
this.picnames = picnames;
\r\n\r\n
let gap = 2;
\r\n
for(let r=0;r<this.rows;r++){\r
\n
for(let c=0;c<this.cols;c++){\r
\n
let ipicx = mwid*c+gap;
\r\n
let ipicy = mhei*r+gap;
\r\n
let npicname =
\"
pic_
\"
+c+
\"
_
\"
+r;
\r\n\r\n
// this.sucposData[npicname] = r+
\"
_
\"
+c;
\r\n\r\n
// let selidx = Math.floor(Math.random()*picnames.length);
\r\n
// let ipicname:string = picnames[selidx];
\r\n
// if(r==c&&r!=this.rows-1){\r
\n
// while(ipicname==npicname){\r
\n
// selidx = Math.floor(Math.random()*picnames.length);
\r\n
// ipicname = picnames[selidx];
\r\n
// }
\r\n
// }
\r\n
let ipic = picarr[npicname];
\r\n
// picnames.splice(selidx,1);
\r\n
this.dicont.addChild(ipic);
\r\n
ipic.x = ipicx;
\r\n
ipic.y = ipicy;
\r\n
// ipic[
\"
postr
\"
] = r+
\"
_
\"
+c;
\r\n\r\n
// ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN,
\r\n
// this.touchPic,this);
\r\n
}
\r\n
}
\r\n
//框线
\r\n
this.lineShape.clear();
\r\n
this.lineShape.beginStroke(0x0069df,4,engine.LINE_CAP.BUTT,engine.LINE_JOIN.BEVEL,100);
\r\n\r\n
this.lineShape.moveTo(0+gap,0+gap);
\r\n
this.lineShape.lineTo(mhei*this.cols+gap,0+gap);
\r\n
this.lineShape.lineTo(mhei*this.cols+gap,mwid*this.rows+gap);
\r\n
this.lineShape.lineTo(0+gap,mwid*this.rows+gap);
\r\n
this.lineShape.lineTo(0+gap,0+gap);
\r\n\r\n
for(let rl=1;rl<this.rows;rl++){\r
\n
this.lineShape.moveTo(0+gap,rl*mhei+gap);
\r\n
this.lineShape.lineTo(mwid*this.cols+gap,rl*mhei+gap);
\r\n
}
\r\n
for(let cl=1;cl<this.cols;cl++){\r
\n
this.lineShape.moveTo(cl*mwid+gap,0+gap);
\r\n
this.lineShape.lineTo(cl*mwid+gap,this.rows*mhei+gap);
\r\n
}
\r\n
this.lineShape.endStroke();
\r\n
\r\n
this.ticker&&clearInterval(this.ticker);
\r\n
this.ticker = setInterval(this.update, 10);
\r\n
}else{\r
\n
console.error(
\"
图片处理失败
\"
);
\r\n
}
\r\n
}
\r\n
luanxu(){\r
\n
let gap = 2;
\r\n
for(let r=0;r<this.rows;r++){\r
\n
for(let c=0;c<this.cols;c++){\r
\n
let ipicx = this.mwid*c+gap;
\r\n
let ipicy = this.mhei*r+gap;
\r\n
let npicname =
\"
pic_
\"
+c+
\"
_
\"
+r;
\r\n\r\n
this.sucposData[npicname] = r+
\"
_
\"
+c;
\r\n\r\n
let selidx = Math.floor(Math.random()*this.picnames.length);
\r\n
let ipicname:string = this.picnames[selidx];
\r\n
if(r==c&&r!=this.rows-1){\r
\n
while(ipicname==npicname){\r
\n
selidx = Math.floor(Math.random()*this.picnames.length);
\r\n
ipicname = this.picnames[selidx];
\r\n
}
\r\n
}
\r\n
let ipic = this.picarr[ipicname];
\r\n
this.picnames.splice(selidx,1);
\r\n
ipic.x = ipicx;
\r\n
ipic.y = ipicy;
\r\n
ipic[
\"
postr
\"
] = r+
\"
_
\"
+c;
\r\n\r\n
ipic.addEventListener(engine.MouseEvent.MOUSE_DOWN,
\r\n
this.touchPic,this);
\r\n
}
\r\n
}
\r\n
}
\r\n
pause(){\r
\n
this.ingame = false;
\r\n
console.error(
\"
拼图暂停
\"
);
\r\n
}
\r\n
resume(){\r
\n
this.lastframetime = Date.now();
\r\n
this.ingame = true;
\r\n
console.error(
\"
拼图继续
\"
);
\r\n
}
\r\n\r\n\r\n
update() {\r
\n
let ntime = Date.now();
\r\n
if(!this.lastframetime){\r
\n
this.lastframetime = ntime;
\r\n
return;
\r\n
}
\r\n
if(this.ingame){\r
\n
let passtime = (ntime - this.lastframetime)/1000;
\r\n
this.passtime += passtime;
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-passtime
\"
,{\r
\n
passtime:this.passtime
\r\n
});
\r\n
let showtime1 = Math.round(this.gametime - this.passtime);
\r\n
// console.log(passtime,this.passtime,this.gametime,this.showtime);
\r\n
if(this.showtime!=showtime1){\r
\n
this.showtime = showtime1;
\r\n
if(this.showtime<=0){\r
\n
this.showtime = 0;
\r\n
this.gameover(2);
\r\n
}
\r\n
// console.log(
\"
倒计时
\"
,this.showtime);
\r\n
engine.globalEvent.dispatchEvent(
\"
pictures-time-update
\"
,{\r
\n
time:this.showtime
\r\n
});
\r\n
}
\r\n
}
\r\n
this.lastframetime = ntime;
\r\n
}
\r\n\r\n
touchPic(e:engine.MouseEvent){\r
\n
if(!this.ingame){\r
\n
return;
\r\n
}
\r\n
// console.log(e.target.name);
\r\n
let selectname = e.target.name;
\r\n
let spx = e.target.x;
\r\n
let spy = e.target.y;
\r\n
let gap = 2;
\r\n
if(this.selectImgArr.length==0){\r
\n
if(this.nselectimg){\r
\n
this.blockcont.addChild(this.nselectimg);
\r\n
this.nselectimg.x = spx-gap;
\r\n
this.nselectimg.y = spy-gap;
\r\n
}
\r\n
this.selectImgArr.push(selectname);
\r\n
}else if(this.selectImgArr.length==1){\r
\n
if(selectname==this.selectImgArr[0]){\r
\n
if(this.nselectimg){\r
\n
this.blockcont.removeChild(this.nselectimg);
\r\n
}
\r\n
this.selectImgArr = new Array();
\r\n
return;
\r\n
}else{\r
\n
this.selectImgArr.push(selectname);
\r\n
this.changeImgPos();
\r\n
}
\r\n
}
\r\n
}
\r\n
changeImgPos(){\r
\n
let img1name = this.selectImgArr[0];
\r\n
let img2name = this.selectImgArr[1];
\r\n\r\n
let img1 = this.dicont.getChildByName(img1name);
\r\n
let img2 = this.dicont.getChildByName(img2name);
\r\n\r\n
let imgpos1x = img1.x;
\r\n
let imgpos1y = img1.y;
\r\n
let imgpos2x = img2.x;
\r\n
let imgpos2y = img2.y;
\r\n\r\n
let imgpostr1 = img1.postr;
\r\n
let imgpostr2 = img2.postr;
\r\n\r\n
img1.x = imgpos2x;
\r\n
img1.y = imgpos2y;
\r\n
img1.postr = imgpostr2;
\r\n\r\n
img2.x = imgpos1x;
\r\n
img2.y = imgpos1y;
\r\n
img2.postr = imgpostr1;
\r\n\r\n
this.selectImgArr = new Array();
\r\n
\r\n
this.movesteps += 1;
\r\n\r\n
if(this.nselectimg){\r
\n
this.blockcont.removeChild(this.nselectimg);
\r\n
}
\r\n
let isuc = this.checkSuccess();
\r\n
if(isuc){\r
\n
console.error(
\"
成功过关
\"
);
\r\n
this.gameover(1);
\r\n
}
\r\n
}
\r\n
checkSuccess(){\r
\n
let isuc:boolean = true;
\r\n
for(let r=0;r<this.rows;r++){\r
\n
for(let c=0;c<this.cols;c++){\r
\n
let ipicname =
\"
pic_
\"
+c+
\"
_
\"
+r;
\r\n
let npicstr = r+
\"
_
\"
+c;
\r\n
let ipic = this.dicont.getChildByName(ipicname);
\r\n
let ipostr = ipic.postr;
\r\n
if(npicstr!=ipostr){\r
\n
isuc = false;
\r\n
break;
\r\n
}
\r\n
}
\r\n
}
\r\n\r\n
return isuc;
\r\n\r\n
}
\r\n
/**
\r\n
*
\r\n
* @param reason 1成功,2失败
\r\n
*/
\r\n
private gameover(reason:number) {\r
\n
this.ingame = false;
\r\n
this.ticker&&clearInterval(this.ticker);
\r\n\r\n
let ntime = Date.now();
\r\n
let gametime = ntime - this.startime;
\r\n
engine.globalEvent.dispatchEvent('pictures-game-over', {\r
\n
reason:reason,
\r\n
time: this.passtime,
\r\n
number:this.movesteps,
\r\n
gametime:gametime
\r\n
});
\r\n
}
\r\n\r\n
}
\r\n
"
,
"/**
\r\n
* Created by rockyl on 2020-01-09.
\r\n
*/
\r\n\r\n
import GameView from
\"
./GameView
\"
;
\r\n
import { injectProps } from
\"
../props
\"
;
\r\n\r\n\r\n
export class GameWrapper extends engine.Container {\r
\n\t
// private _status;
\r\n\t
private _gameView: GameView;
\r\n\r\n\r\n\r\n\r\n\r\n\t
constructor() {\r
\n\t\t
super();
\r\n\r\n\t\t
//创建实例
\r\n\t\t
this._gameView = new GameView();
\r\n\t\t
this.addChild(this._gameView);
\r\n\r\n\t\t
engine.globalEvent.addEventListener('pictures-initgame', this.initgame, this);
\r\n\t\t
engine.globalEvent.addEventListener('pictures-start', this.start, this);
\r\n\t\t
engine.globalEvent.addEventListener('pictures-luanxu', this.luanxu, this);
\r\n\t\t
engine.globalEvent.addEventListener('pictures-pause', this.pause, this);
\r\n\t\t
engine.globalEvent.addEventListener('pictures-resume', this.resume, this);
\r\n\t
}
\r\n\t
initgame(event: engine.Event) {\r
\n\t\t
injectProps(event.data);
\r\n\r\n\t\t
// this._status = 1;
\r\n\r\n\t\t
this._gameView.initgame();
\r\n\t
}
\r\n\t
start(event: engine.Event) {\r
\n\t\t
injectProps(event.data);
\r\n\r\n\t\t
// this._status = 1;
\r\n\r\n\t\t
this._gameView.start();
\r\n\t
}
\r\n\t
luanxu()
{
\r\n\t\tthis._gameView.luanxu();\r\n\t
}
\r\n\t
pause(event: engine.Event)
{
\r\n\t\t\r\n\t\tthis._gameView.pause();\r\n\t}\r\n\tresume(event:engine.Event){\r\n\t\tthis._gameView.resume();\r\n\t}\r\n
}
\r\n
"
,
"/**
\r\n
* Created by rockyl on 2019-11-20.
\r\n
*/
\r\n\r\n
import
{
GameWrapper
}
from
\"
./game/GameWrapper
\"
;
\r\n
import {injectProps, prepareProps} from
\"
./props
\"
;
\r\n\r\n
export default function (props) {\r
\n\t
prepareProps();
\r\n\t
injectProps(props);
\r\n\r\n\t
let instance = new GameWrapper();
\r\n\t\r\n\t
return instance;
\r\n
}
\r\n
"
],
"names"
:
[
"__extends"
],
"mappings"
:
";;;;;;CAIO,IAAI,KAAK,GAAQ,EAAE,CAAC;AAE3B,UAAgB,YAAY;KAC3B,IAAI,SAAS,GAAG,QAAQ,EAAE,CAAC;KAE3B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;CACrC,CAAC;AAED,UAAgB,WAAW,CAAC,CAAC;KAC5B,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;CAC7B,CAAC;;;UCVe,UAAU,CAAC,IAAI;KAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC;AAED,UAAgB,gBAAgB,CAAC,IAAI;KACpC,OAAO,UAAU,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,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AAL,UAAM,KAAmB;SACxB,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAIxB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KACD,4BAAM,GAAN;SACC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KACD,2BAAK,GAAL,UAAM,KAAmB;SAExB,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;MACvB;KACD,4BAAM,GAAN,UAAO,KAAkB;SACxB,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC;MACxB;KACF,kBAAC;CAAD,CAAC,CA7CgC,MAAM,CAAC,SAAS,GA6ChD;;;iBC9CwB,KAAK;KAC7B,YAAY,EAAE,CAAC;KACf,WAAW,CAAC,KAAK,CAAC,CAAC;KAEnB,IAAI,QAAQ,GAAG,IAAI,WAAW,EAAE,CAAC;KAEjC,OAAO,QAAQ,CAAC;CACjB,CAAC;;;;;;;;;"
}
\ No newline at end of file
src/custom/pintu/src/game/GameView.ts
View file @
e4229d77
...
...
@@ -193,7 +193,6 @@ export default class GameView extends engine.Container {
engine
.
globalEvent
.
dispatchEvent
(
"pictures-time-passtime"
,{
passtime
:
this
.
passtime
});
console
.
log
(
"start-----------------"
,
actidx
);
this
.
rows
=
props
.
rows
;
this
.
cols
=
props
.
cols
;
...
...
src/custom/pintu/src/game/qietu.ts
View file @
e4229d77
...
...
@@ -8,7 +8,6 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
try
{
let
t
:
engine
.
Texture
;
if
(
type1
==
1
){
console
.
log
(
"直接使用已加载的tex"
);
t
=
url
;
}
else
{
t
=
await
loadImageByUrl
(
url
)
as
engine
.
Texture
;
...
...
@@ -21,7 +20,6 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
let
mwid
=
t
.
width
;
let
mhei
=
t
.
height
;
if
(
mwid
<
10
||
mhei
<
10
){
console
.
log
(
"调整222222222222"
);
await
new
Promise
(
res
=>
{
setTimeout
(
function
(){
res
();
...
...
@@ -29,8 +27,6 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
})
return
qietu
(
t
,
1
,
rows
,
cols
,
parent
);
}
console
.
log
(
'图片'
,
t
);
console
.
log
(
"图片获取尺寸"
,
mwid
,
mhei
);
if
(
mwid
>
mhei
){
if
(
mhei
<
setimgwid
){
mwid
=
mwid
*
setimgwid
/
mhei
;
...
...
@@ -42,7 +38,6 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
mwid
=
setimgwid
;
}
}
console
.
log
(
"适配后的图片尺寸"
,
mwid
,
mhei
);
let
picarr
=
{};
let
picnames
=
[];
...
...
@@ -53,6 +48,9 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
let
addlix
;
let
startliy
;
let
addliy
;
let
twid1
;
let
thei1
;
if
(
mwid
>
mhei
){
chax
=
(
mwid
-
mhei
)
/
2
;
startlix
=
chax
/
mwid
;
...
...
@@ -60,6 +58,9 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
startliy
=
0
;
addliy
=
1
/
rows
;
twid1
=
mwid
*
setimgwid
/
mhei
;
thei1
=
setimgwid
;
}
else
{
startlix
=
0
;
addlix
=
1
/
cols
;
...
...
@@ -67,15 +68,18 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
chay
=
(
mhei
-
mwid
)
/
2
;
startliy
=
chay
/
mhei
;
addliy
=
(
mwid
/
rows
)
/
mhei
;
thei1
=
mhei
*
setimgwid
/
mwid
;
twid1
=
setimgwid
;
}
console
.
log
(
"切图准备"
,
startlix
,
addlix
,
startliy
,
addliy
,
mwid
,
mhei
);
let
txt1
=
new
engine
.
Label
();
txt1
.
fillColor
=
"red"
;
txt1
.
size
=
24
;
txt1
.
text
=
startlix
.
toFixed
(
2
)
+
";"
+
addlix
.
toFixed
(
2
)
+
";"
+
startliy
.
toFixed
(
2
)
+
";"
+
addliy
.
toFixed
(
2
)
+
";"
+
mwid
.
toFixed
(
2
)
+
";"
+
mhei
.
toFixed
(
2
)
+
";"
parent
.
addChild
(
txt1
);
txt1
.
y
=
-
100
;
//
console.log("切图准备",startlix,addlix,startliy,addliy,mwid,mhei);
//
let txt1 = new engine.Label();
//
txt1.fillColor = "red";
//
txt1.size = 24;
//
txt1.text = startlix.toFixed(2)+";"+addlix.toFixed(2)+";"+startliy.toFixed(2)+";"+addliy.toFixed(2)+";"+mwid.toFixed(2)+";"+mhei.toFixed(2)+";"
//
parent.addChild(txt1);
//
txt1.y = -100;
for
(
let
r
=
0
;
r
<
rows
;
r
++
){
let
startx
=
startlix
+
addlix
*
r
;
let
endx
=
startx
+
addlix
;
...
...
@@ -93,16 +97,32 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
starty
,
endx
])
let
isprite
=
new
engine
.
Sprite
(
t
);
//
let isprite = new engine.Sprite(t);
isprite
.
uvs
=
uvs
;
// isprite.uvs = uvs;
let
nsprite
=
new
engine
.
Container
();
let
isprite
=
new
engine
.
ScrollView
();
let
nsp
=
new
engine
.
Sprite
(
t
);
isprite
.
addChild
(
nsp
);
nsp
.
width
=
twid1
;
nsp
.
height
=
thei1
;
isprite
.
mouseEnabled
=
false
;
isprite
.
mouseChildren
=
false
;
nsp
.
x
=
-
starty
*
twid1
;
nsp
.
y
=
-
startx
*
thei1
;
isprite
.
width
=
mwid1
;
isprite
.
height
=
mhei1
;
nsprite
.
addChild
(
isprite
);
nsprite
.
width
=
mwid1
;
nsprite
.
height
=
mhei1
;
let
ispritename
=
"pic_"
+
c
+
"_"
+
r
;
i
sprite
.
name
=
ispritename
;
picarr
[
ispritename
]
=
i
sprite
;
n
sprite
.
name
=
ispritename
;
picarr
[
ispritename
]
=
n
sprite
;
picnames
.
push
(
ispritename
);
}
}
...
...
@@ -114,8 +134,6 @@ export default async(url:any,type1:number, rows:number, cols:number,parent:engin
picnames
:
picnames
};
}
catch
(
e
){
console
.
error
(
"图片加载失败"
,
e
);
console
.
log
(
url
,
rows
,
cols
);
return
{
res
:
false
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment