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
9663a003
Commit
9663a003
authored
Jun 04, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
720aaa32
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
318 deletions
+31
-318
.DS_Store
dist/.DS_Store
+0
-0
pictures.json
dist/customs/pictures.json
+4
-3
app.js
src/custom/pictures/debug/app.js
+5
-3
load-assets.js
src/custom/pictures/debug/load-assets.js
+1
-1
main.js
src/custom/pictures/debug/main.js
+1
-295
main.js.map
src/custom/pictures/debug/main.js.map
+1
-1
meta.json
src/custom/pictures/meta.json
+3
-2
GameView.ts
src/custom/pictures/src/game/GameView.ts
+16
-13
No files found.
dist/.DS_Store
View file @
9663a003
No preview for this file type
dist/customs/pictures.json
View file @
9663a003
This diff is collapsed.
Click to expand it.
src/custom/pictures/debug/app.js
View file @
9663a003
...
@@ -47,7 +47,8 @@ function launchWithCustomModule(customModule) {
...
@@ -47,7 +47,8 @@ function launchWithCustomModule(customModule) {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'pictures-start'
,
{
engine
.
globalEvent
.
dispatchEvent
(
'pictures-start'
,
{
picUrl
:
"http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png"
picUrl
:
"http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png"
,
blockUrl
:
"888"
,
});
});
const
d
=
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
);
const
d
=
engine
.
gameStage
.
sceneContainer
.
getChildAt
(
0
);
...
@@ -57,11 +58,12 @@ function launchWithCustomModule(customModule) {
...
@@ -57,11 +58,12 @@ function launchWithCustomModule(customModule) {
setTimeout
(()
=>
{
setTimeout
(()
=>
{
engine
.
globalEvent
.
dispatchEvent
(
'pictures-start'
,
{
engine
.
globalEvent
.
dispatchEvent
(
'pictures-start'
,
{
picUrl
:
"http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png"
picUrl
:
"http://yun.duiba.com.cn/aurora/assets/e1593b97c27077b85b92f7eaaeae1ed64a1eb79a.png"
,
// picUrl: "http://yun.duiba.com.cn/aurora/assets/d23e73d37ec01931e48cbd0a4095367044c5675c.png"
// picUrl: "http://yun.duiba.com.cn/aurora/assets/d23e73d37ec01931e48cbd0a4095367044c5675c.png"
blockUrl
:
"888"
});
});
},
10
*
1000
);
},
5
*
1000
);
});
});
engine
.
globalEvent
.
addEventListener
(
'pictures-time-update'
,
(
e
)
=>
{
engine
.
globalEvent
.
addEventListener
(
'pictures-time-update'
,
(
e
)
=>
{
// console.log(e.type, e.data);
// console.log(e.type, e.data);
...
...
src/custom/pictures/debug/load-assets.js
View file @
9663a003
...
@@ -6,7 +6,7 @@ const assets = [
...
@@ -6,7 +6,7 @@ const assets = [
{
{
"name"
:
"玩家icon"
,
"name"
:
"玩家icon"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5b3e30496b2d9fdafb0cf3835fd6704ce10e45b4.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5b3e30496b2d9fdafb0cf3835fd6704ce10e45b4.png"
,
"uuid"
:
"
66f23d13-82a5-4cec-9496-301ec240d087
"
,
"uuid"
:
"
888
"
,
"ext"
:
".png"
"ext"
:
".png"
},
},
{
{
...
...
src/custom/pictures/debug/main.js
View file @
9663a003
This diff is collapsed.
Click to expand it.
src/custom/pictures/debug/main.js.map
View file @
9663a003
This diff is collapsed.
Click to expand it.
src/custom/pictures/meta.json
View file @
9663a003
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
{
{
"name"
:
"遮罩"
,
"name"
:
"遮罩"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5b3e30496b2d9fdafb0cf3835fd6704ce10e45b4.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/5b3e30496b2d9fdafb0cf3835fd6704ce10e45b4.png"
,
"uuid"
:
"
66f23d13-82a5-4cec-9496-301ec240d087
"
,
"uuid"
:
"
888
"
,
"ext"
:
".png"
"ext"
:
".png"
}
}
],
],
...
@@ -58,7 +58,8 @@
...
@@ -58,7 +58,8 @@
"pictures-start"
:
{
"pictures-start"
:
{
"alias"
:
"开始"
,
"alias"
:
"开始"
,
"data"
:
{
"data"
:
{
"picUrl"
:
"图片路径"
"picUrl"
:
"图片路径"
,
"blockUrl"
:
"blockUrl"
}
}
},
},
"pictures-stop"
:
{
"pictures-stop"
:
{
...
...
src/custom/pictures/src/game/GameView.ts
View file @
9663a003
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
{
props
}
from
"../props"
;
import
{
props
}
from
"../props"
;
import
qietu
from
"./qietu"
;
import
qietu
from
"./qietu"
;
import
{
getIndexFromRC
,
getRandomArray
,
getTexture
ByName
,
getTexture
}
from
"./utils"
;
import
{
getIndexFromRC
,
getRandomArray
,
getTexture
}
from
"./utils"
;
import
ObjectPool
=
engine
.
ObjectPool
;
import
ObjectPool
=
engine
.
ObjectPool
;
// let OFFSET_X;
// let OFFSET_X;
...
@@ -24,9 +24,12 @@ export default class GameView extends engine.Container {
...
@@ -24,9 +24,12 @@ export default class GameView extends engine.Container {
private
_timeCounter
=
0
;
private
_timeCounter
=
0
;
start
()
{
start
()
{
this
.
guideHole
=
new
engine
.
Image
(
getTexture
());
if
(
!
this
.
guideHole
)
{
this
.
guideHole
.
mouseChildren
=
this
.
guideHole
.
mouseEnabled
=
false
;
this
.
guideHole
=
new
engine
.
Image
();
this
.
guideHole
.
source
=
'asset://'
+
props
.
blockUrl
;
this
.
guideHole
.
mouseChildren
=
this
.
guideHole
.
mouseEnabled
=
false
;
}
if
(
this
.
pictures
)
{
if
(
this
.
pictures
)
{
for
(
const
pic
of
this
.
pictures
)
{
for
(
const
pic
of
this
.
pictures
)
{
if
(
pic
&&
pic
.
parent
)
if
(
pic
&&
pic
.
parent
)
...
@@ -80,10 +83,10 @@ export default class GameView extends engine.Container {
...
@@ -80,10 +83,10 @@ export default class GameView extends engine.Container {
GAME_TIME
-=
0.01
GAME_TIME
-=
0.01
GAME_TIME
=
this
.
afterPointTwo
(
GAME_TIME
);
GAME_TIME
=
this
.
afterPointTwo
(
GAME_TIME
);
GAME_TIME
=
GAME_TIME
.
toFixed
(
2
)
GAME_TIME
=
GAME_TIME
.
toFixed
(
2
)
if
(
GAME_TIME
<
10
)
{
if
(
GAME_TIME
<
10
)
{
GAME_TIME
=
'0'
+
GAME_TIME
GAME_TIME
=
'0'
+
GAME_TIME
}
}
console
.
log
(
GAME_TIME
);
//
console.log(GAME_TIME);
engine
.
globalEvent
.
dispatchEvent
(
'pictures-time-update'
,
{
engine
.
globalEvent
.
dispatchEvent
(
'pictures-time-update'
,
{
...
@@ -99,12 +102,12 @@ export default class GameView extends engine.Container {
...
@@ -99,12 +102,12 @@ export default class GameView extends engine.Container {
}
}
afterPointTwo
(
n
)
{
afterPointTwo
(
n
)
{
var
floatN
=
parseFloat
(
n
);
var
floatN
=
parseFloat
(
n
);
if
(
isNaN
(
floatN
))
{
if
(
isNaN
(
floatN
))
{
return
;
return
;
}
}
floatN
=
Math
.
round
(
floatN
*
100
)
/
100
;
floatN
=
Math
.
round
(
floatN
*
100
)
/
100
;
...
@@ -151,7 +154,7 @@ export default class GameView extends engine.Container {
...
@@ -151,7 +154,7 @@ export default class GameView extends engine.Container {
private
picturesWrapper
:
engine
.
Sprite
;
private
picturesWrapper
:
engine
.
Sprite
;
private
guideHole
:
engine
.
Sprit
e
;
private
guideHole
:
engine
.
Imag
e
;
createRects
()
{
}
createRects
()
{
}
setup
()
{
setup
()
{
...
@@ -238,10 +241,10 @@ export default class GameView extends engine.Container {
...
@@ -238,10 +241,10 @@ export default class GameView extends engine.Container {
}
}
listenStageOn
=
1
;
listenStageOn
=
1
;
stageOnUp
(
e
)
{
stageOnUp
(
e
)
{
this
.
stage
.
removeEventListener
(
this
.
stage
.
removeEventListener
(
engine
.
MouseEvent
.
MOUSE_MOVE
,
engine
.
MouseEvent
.
MOUSE_MOVE
,
this
.
onMove
,
this
.
onMove
,
...
@@ -319,7 +322,7 @@ export default class GameView extends engine.Container {
...
@@ -319,7 +322,7 @@ export default class GameView extends engine.Container {
this
.
dragPic
.
y
=
this
.
distanceY
this
.
dragPic
.
y
=
this
.
distanceY
}
}
}
}
private
onSuccess
()
{
private
onSuccess
()
{
...
@@ -330,7 +333,7 @@ export default class GameView extends engine.Container {
...
@@ -330,7 +333,7 @@ export default class GameView extends engine.Container {
onMove
(
e
:
engine
.
MouseEvent
)
{
onMove
(
e
:
engine
.
MouseEvent
)
{
// 当前图片的位置
// 当前图片的位置
this
.
dragPic
.
x
=
e
.
stageX
-
this
.
localPicX
-
(
750
-
props
.
W
)
/
2
;
this
.
dragPic
.
x
=
e
.
stageX
-
this
.
localPicX
-
(
750
-
props
.
W
)
/
2
;
this
.
dragPic
.
y
=
e
.
stageY
-
this
.
localPicY
-
(
this
.
stage
.
height
-
props
.
H
)
/
2
;
this
.
dragPic
.
y
=
e
.
stageY
-
this
.
localPicY
-
(
this
.
stage
.
height
-
props
.
H
)
/
2
;
console
.
log
(
'fuck on this.stage.height'
,
this
.
stage
.
height
)
console
.
log
(
'fuck on this.stage.height'
,
this
.
stage
.
height
)
// console.log(this.dragPic.x, this.dragPic.y)
// console.log(this.dragPic.x, this.dragPic.y)
...
...
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