Commit 69017731 authored by 汪欢's avatar 汪欢

拼图0.4

parent 24d78c4c
This diff is collapsed.
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
function injectProps(p) { function injectProps(p) {
engine.injectProp(props, p); engine.injectProp(props, p);
} }
//# sourceMappingURL=props.js.map
var picMap = {}; var picMap = {};
var posMap = {}; var posMap = {};
...@@ -60,7 +59,6 @@ ...@@ -60,7 +59,6 @@
posMap[url] = pos.concat([]); posMap[url] = pos.concat([]);
return [spr, pos]; return [spr, pos];
}); });
//# sourceMappingURL=qietu.js.map
function getTexture(uuid) { function getTexture(uuid) {
return engine.Texture.from(getAssetByUUID(uuid).uuid); return engine.Texture.from(getAssetByUUID(uuid).uuid);
...@@ -78,7 +76,6 @@ ...@@ -78,7 +76,6 @@
return .5 - Math.random(); return .5 - Math.random();
}); });
} }
//# sourceMappingURL=utils.js.map
var MAX_COL; var MAX_COL;
var MAX_ROW; var MAX_ROW;
...@@ -103,6 +100,7 @@ ...@@ -103,6 +100,7 @@
}); });
var result = qietu(this.picturesWrapper, props.picUrl, MAX_COL, MAX_ROW); var result = qietu(this.picturesWrapper, props.picUrl, MAX_COL, MAX_ROW);
this.picturesWrapper.addChild(this.guideHole); this.picturesWrapper.addChild(this.guideHole);
console.log(this.picturesWrapper);
this.pictures = result[0]; this.pictures = result[0];
this.rightList = this.pictures.concat([]); this.rightList = this.pictures.concat([]);
var posList = result[1]; var posList = result[1];
...@@ -230,10 +228,13 @@ ...@@ -230,10 +228,13 @@
GameView.prototype.onMove = function (e) { GameView.prototype.onMove = function (e) {
this.dragPic.x = e.stageX - this.localPicX; this.dragPic.x = e.stageX - this.localPicX;
this.dragPic.y = e.stageY - this.localPicY; this.dragPic.y = e.stageY - this.localPicY;
console.log(this.dragPic.x, this.dragPic.y);
this.centerX = this.dragPic.x + w / 2; this.centerX = this.dragPic.x + w / 2;
this.centerY = this.dragPic.y + h / 2; this.centerY = this.dragPic.y + h / 2;
}; };
GameView.prototype.onClk = function (e) {
this._timeCounter = 0;
this.start();
};
return GameView; return GameView;
}(engine.Container)); }(engine.Container));
...@@ -256,7 +257,6 @@ ...@@ -256,7 +257,6 @@
}; };
return GameWrapper; return GameWrapper;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=GameWrapper.js.map
function index (props) { function index (props) {
prepareProps(); prepareProps();
...@@ -264,7 +264,6 @@ ...@@ -264,7 +264,6 @@
var instance = new GameWrapper(); var instance = new GameWrapper();
return instance; return instance;
} }
//# sourceMappingURL=index.js.map
return index; return index;
......
This diff is collapsed.
...@@ -30,6 +30,9 @@ export default class GameView extends engine.Container { ...@@ -30,6 +30,9 @@ export default class GameView extends engine.Container {
// 图片一维数组 // 图片一维数组
const result = qietu(this.picturesWrapper, props.picUrl, MAX_COL, MAX_ROW); const result = qietu(this.picturesWrapper, props.picUrl, MAX_COL, MAX_ROW);
this.picturesWrapper.addChild(this.guideHole); this.picturesWrapper.addChild(this.guideHole);
console.log(this.picturesWrapper)
this.pictures = result[0]; this.pictures = result[0];
this.rightList = this.pictures.concat([]); this.rightList = this.pictures.concat([]);
const posList = result[1]; const posList = result[1];
...@@ -156,8 +159,8 @@ export default class GameView extends engine.Container { ...@@ -156,8 +159,8 @@ export default class GameView extends engine.Container {
// const btn = new engine.Rect(); // const btn = new engine.Rect();
// btn.width = 200; // btn.width = 200;
// btn.height = 100; // btn.height = 100;
// // btn.stage.top = 1000; // btn.stage.top = 1000;
// // btn.stage.left = 350; // btn.stage.left = 350;
// btn.fillColor = 'cyan'; // btn.fillColor = 'cyan';
// this.addChild(btn) // this.addChild(btn)
...@@ -303,7 +306,6 @@ export default class GameView extends engine.Container { ...@@ -303,7 +306,6 @@ export default class GameView extends engine.Container {
// 当前图片的位置 // 当前图片的位置
this.dragPic.x = e.stageX - this.localPicX; this.dragPic.x = e.stageX - this.localPicX;
this.dragPic.y = e.stageY - this.localPicY; this.dragPic.y = e.stageY - this.localPicY;
console.log(this.dragPic.x,this.dragPic.y)
// 当前图片的中心位置 // 当前图片的中心位置
this.centerX = this.dragPic.x + w / 2; this.centerX = this.dragPic.x + w / 2;
...@@ -311,13 +313,13 @@ export default class GameView extends engine.Container { ...@@ -311,13 +313,13 @@ export default class GameView extends engine.Container {
} }
// onClk(e){ onClk(e){
// // 重置时间 // 重置时间
// this._timeCounter = 0; this._timeCounter = 0;
// //重置图片顺序 //重置图片顺序
this.start();
// } }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment