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
851853ad
Commit
851853ad
authored
Jun 04, 2020
by
汪欢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拼图计时器0.2
parent
44ab19be
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
14 deletions
+19
-14
pictures.json
dist/customs/pictures.json
+1
-1
main.js
src/custom/pictures/debug/main.js
+6
-1
main.js.map
src/custom/pictures/debug/main.js.map
+1
-1
GameView.ts
src/custom/pictures/src/game/GameView.ts
+11
-11
No files found.
dist/customs/pictures.json
View file @
851853ad
This diff is collapsed.
Click to expand it.
src/custom/pictures/debug/main.js
View file @
851853ad
...
...
@@ -138,6 +138,10 @@
GameView
.
prototype
.
onTimer
=
function
()
{
GAME_TIME
-=
0.01
;
GAME_TIME
=
this
.
afterPointTwo
(
GAME_TIME
);
GAME_TIME
=
GAME_TIME
.
toFixed
(
2
);
if
(
GAME_TIME
<
10
)
{
GAME_TIME
=
'0'
+
GAME_TIME
;
}
console
.
log
(
GAME_TIME
);
engine
.
globalEvent
.
dispatchEvent
(
'pictures-time-update'
,
{
second
:
this
.
getSecond
(),
...
...
@@ -192,7 +196,7 @@
this
.
indexI
=
Math
.
floor
(
this
.
distanceY
/
(
h
+
GAP
));
this
.
index
=
(
this
.
indexI
)
*
MAX_COL
+
this
.
indexJ
;
this
.
centerX
=
Math
.
floor
(
e
.
clientX
/
w
)
*
w
+
w
/
2
;
this
.
centerY
=
Math
.
floor
(
e
.
clientY
/
h
)
*
h
+
w
/
2
;
this
.
centerY
=
Math
.
floor
(
e
.
clientY
/
h
)
*
h
+
h
/
2
;
this
.
stage
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
this
.
onMove
,
this
);
this
.
stage
.
addEventListener
(
engine
.
MouseEvent
.
MOUSE_UP
,
this
.
stageOnUp
,
this
);
};
...
...
@@ -253,6 +257,7 @@
};
return
GameView
;
}(
engine
.
Container
));
//# sourceMappingURL=GameView.js.map
var
GameWrapper
=
(
function
(
_super
)
{
tslib
.
__extends
(
GameWrapper
,
_super
);
...
...
src/custom/pictures/debug/main.js.map
View file @
851853ad
This diff is collapsed.
Click to expand it.
src/custom/pictures/src/game/GameView.ts
View file @
851853ad
...
...
@@ -69,11 +69,6 @@ export default class GameView extends engine.Container {
this
.
onTimer
();
},
10
)
}
// this._timeCounter += 0.01;
// this._timeCounter = this.afterPointTwo(this._timeCounter);
// this._timeCounter = Math.floor((this._timeCounter + 0.1) * 10) / 10;
// console.log(this._timeCounter)
onTimer
()
{
...
...
@@ -81,6 +76,10 @@ export default class GameView extends engine.Container {
// 以GAME_TIME为标准
GAME_TIME
-=
0.01
GAME_TIME
=
this
.
afterPointTwo
(
GAME_TIME
);
GAME_TIME
=
GAME_TIME
.
toFixed
(
2
)
if
(
GAME_TIME
<
10
){
GAME_TIME
=
'0'
+
GAME_TIME
}
console
.
log
(
GAME_TIME
);
...
...
@@ -97,22 +96,25 @@ export default class GameView extends engine.Container {
}
afterPointTwo
(
n
)
{
var
floatN
=
parseFloat
(
n
);
if
(
isNaN
(
floatN
))
{
return
;
}
floatN
=
Math
.
round
(
floatN
*
100
)
/
100
;
return
floatN
;
}
getSecond
()
{
return
GAME_TIME
// return GAME_TIME - this._timeCounter;
}
stop
()
{
// this._timeCounter = 0;
GAME_TIME
=
props
.
GAME_TIME
clearInterval
(
this
.
_timer
);
}
...
...
@@ -214,14 +216,12 @@ export default class GameView extends engine.Container {
this
.
index
=
(
this
.
indexI
)
*
MAX_COL
+
this
.
indexJ
;
// 图片的中心位置
// this.centerX = e.clientX + w / 2;
// this.centerY = e.clientY + h / 2;
this
.
centerX
=
Math
.
floor
(
e
.
clientX
/
w
)
*
w
+
w
/
2
;
this
.
centerY
=
Math
.
floor
(
e
.
clientY
/
h
)
*
h
+
w
/
2
this
.
centerY
=
Math
.
floor
(
e
.
clientY
/
h
)
*
h
+
h
/
2
this
.
stage
.
addEventListener
(
...
...
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