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
69017731
Commit
69017731
authored
Jun 04, 2020
by
汪欢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拼图0.4
parent
24d78c4c
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
18 deletions
+19
-18
pictures.json
dist/customs/pictures.json
+2
-2
main.js
src/custom/pictures/debug/main.js
+5
-6
main.js.map
src/custom/pictures/debug/main.js.map
+1
-1
GameView.ts
src/custom/pictures/src/game/GameView.ts
+11
-9
No files found.
dist/customs/pictures.json
View file @
69017731
This diff is collapsed.
Click to expand it.
src/custom/pictures/debug/main.js
View file @
69017731
...
@@ -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
;
...
...
src/custom/pictures/debug/main.js.map
View file @
69017731
This diff is collapsed.
Click to expand it.
src/custom/pictures/src/game/GameView.ts
View file @
69017731
...
@@ -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
();
//
}
}
}
}
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