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
0c261be1
Commit
0c261be1
authored
Jun 03, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
a65da7ca
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
17 deletions
+16
-17
pictures.json
dist/customs/pictures.json
+4
-4
app.js
src/custom/pictures/debug/app.js
+1
-1
main.js
src/custom/pictures/debug/main.js
+1
-1
main.js.map
src/custom/pictures/debug/main.js.map
+1
-1
meta.json
src/custom/pictures/meta.json
+3
-3
GameView.ts
src/custom/pictures/src/game/GameView.ts
+6
-7
No files found.
dist/customs/pictures.json
View file @
0c261be1
This diff is collapsed.
Click to expand it.
src/custom/pictures/debug/app.js
View file @
0c261be1
...
...
@@ -53,7 +53,7 @@ function launchWithCustomModule(customModule) {
},
500
);
});
engine
.
globalEvent
.
addEventListener
(
'pictures-time-update'
,
(
e
)
=>
{
console
.
log
(
e
.
type
,
e
.
data
);
//
console.log(e.type, e.data);
});
engine
.
globalEvent
.
addEventListener
(
'pictures-game-fail'
,
(
e
)
=>
{
console
.
log
(
e
.
type
,
e
.
data
);
...
...
src/custom/pictures/debug/main.js
View file @
0c261be1
This diff is collapsed.
Click to expand it.
src/custom/pictures/debug/main.js.map
View file @
0c261be1
This diff is collapsed.
Click to expand it.
src/custom/pictures/meta.json
View file @
0c261be1
...
...
@@ -5,12 +5,12 @@
"MAX_COL"
:
{
"alias"
:
"图片分成几列"
,
"type"
:
"number"
,
"default"
:
3
"default"
:
2
},
"MAX_ROW"
:
{
"alias"
:
"图片分成几行"
,
"type"
:
"number"
,
"default"
:
4
"default"
:
2
},
"W"
:
{
"alias"
:
"图片的宽度"
,
...
...
@@ -30,7 +30,7 @@
"GAME_TIME"
:
{
"alias"
:
"游戏时间"
,
"type"
:
"number"
,
"default"
:
2
0
"default"
:
5
0
}
},
...
...
src/custom/pictures/src/game/GameView.ts
View file @
0c261be1
...
...
@@ -60,9 +60,9 @@ export default class GameView extends engine.Container {
}
//
this._timer = setInterval(() => {
//
this.onTimer();
//
}, 10)
this
.
_timer
=
setInterval
(()
=>
{
this
.
onTimer
();
},
10
)
}
...
...
@@ -71,7 +71,7 @@ export default class GameView extends engine.Container {
this
.
_timeCounter
+=
0.01
;
this
.
_timeCounter
=
this
.
afterPointTwo
(
this
.
_timeCounter
);
// this._timeCounter = Math.floor((this._timeCounter + 0.1) * 10) / 10;
console
.
log
(
this
.
_timeCounter
)
//
console.log(this._timeCounter)
engine
.
globalEvent
.
dispatchEvent
(
'pictures-time-update'
,
{
second
:
this
.
getSecond
(),
...
...
@@ -100,7 +100,6 @@ export default class GameView extends engine.Container {
}
stop
()
{
// this.countTime = 0
this
.
_timeCounter
=
0
;
clearInterval
(
this
.
_timer
);
...
...
@@ -302,15 +301,15 @@ export default class GameView extends engine.Container {
private
onSuccess
()
{
console
.
log
(
'拼图成功!'
);
this
.
stop
();
engine
.
globalEvent
.
dispatchEvent
(
'pictures-game-success'
,
{
time
:
this
.
_timeCounter
});
this
.
stop
();
}
onMove
(
e
:
engine
.
MouseEvent
)
{
// 当前图片的位置
this
.
dragPic
.
x
=
e
.
stageX
-
this
.
localPicX
;
this
.
dragPic
.
y
=
e
.
stageY
-
this
.
localPicY
;
console
.
log
(
this
.
dragPic
.
x
,
this
.
dragPic
.
y
)
//
console.log(this.dragPic.x, this.dragPic.y)
// 当前图片的中心位置
this
.
centerX
=
this
.
dragPic
.
x
+
w
/
2
;
...
...
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