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
57aa8bf6
Commit
57aa8bf6
authored
Mar 27, 2020
by
13732208043
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
茶叶更新
parent
7393d156
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
262 additions
and
221 deletions
+262
-221
pick-tea.json
dist/customs/pick-tea.json
+32
-13
main.js
src/custom/pick-tea/debug/main.js
+69
-89
main.js.map
src/custom/pick-tea/debug/main.js.map
+1
-1
meta.json
src/custom/pick-tea/meta.json
+31
-12
GameView.ts
src/custom/pick-tea/src/game/GameView.ts
+108
-99
GameWrapper.ts
src/custom/pick-tea/src/game/GameWrapper.ts
+9
-5
utils.ts
src/custom/pick-tea/src/game/utils.ts
+12
-2
No files found.
dist/customs/pick-tea.json
View file @
57aa8bf6
This diff is collapsed.
Click to expand it.
src/custom/pick-tea/debug/main.js
View file @
57aa8bf6
This diff is collapsed.
Click to expand it.
src/custom/pick-tea/debug/main.js.map
View file @
57aa8bf6
This diff is collapsed.
Click to expand it.
src/custom/pick-tea/meta.json
View file @
57aa8bf6
{
"name"
:
"采茶叶"
,
"desc"
:
"采茶叶模
块
"
,
"desc"
:
"采茶叶模
左上角0,0点
"
,
"props"
:
{
"versePos"
:
{
"alias"
:
"诗句的起始位置"
,
...
...
@@ -10,7 +10,7 @@
"verses"
:
{
"alias"
:
"诗句"
,
"type"
:
"array<string>"
,
"default"
:
"今
朝有酒今朝醉,今宵更有湘江月,找出霏霏满碗花,雨过林霏清石气,秋将山翠入诗心,生怕芳丛鹰嘴芽,老郎封寄谪仙家
"
"default"
:
"今
宵更有湘江月,照出霏霏满碗花,雨过林霏清石气,秋将山翠入诗心
"
},
"verseLabel"
:
{
"alias"
:
"提示语框xys"
,
...
...
@@ -22,6 +22,16 @@
"type"
:
"array<string>"
,
"default"
:
"#33628b,#99b1c5"
},
"showFrontImg"
:
{
"alias"
:
"茶叶前景图1显示2隐藏"
,
"type"
:
"number"
,
"default"
:
"1"
},
"FrontImgPos"
:
{
"alias"
:
"茶叶前景图位置"
,
"type"
:
"array<number>"
,
"default"
:
"0,584"
},
"pickTeaSpeed"
:
{
"alias"
:
"采集茶叶的速度ms"
,
"type"
:
"number"
,
...
...
@@ -30,12 +40,12 @@
"basketSvgaPos"
:
{
"alias"
:
"人物的位置"
,
"type"
:
"array<number>"
,
"default"
:
"110,4
2
0"
"default"
:
"110,4
1
0"
},
"addOneSvgaPos"
:
{
"alias"
:
"+1SVGA的位置"
,
"type"
:
"array<number>"
,
"default"
:
"
70,72
0"
"default"
:
"
0,-10
0"
},
"pickTeaSvgaPos"
:
{
"alias"
:
"采茶叶SVGA的位置"
,
...
...
@@ -50,12 +60,12 @@
"handGraspSvgaPos"
:
{
"alias"
:
"手点击SVGA的位置"
,
"type"
:
"array<number>"
,
"default"
:
"
543,791
"
"default"
:
"
477,-29
"
},
"handGraspMovePos"
:
{
"alias"
:
"手点击移动的位置"
,
"type"
:
"array<number>"
,
"default"
:
"
460,700
"
"default"
:
"
372,-145
"
},
"progressbarBgImgPos"
:
{
"alias"
:
"进度条底图的位置"
,
...
...
@@ -65,7 +75,7 @@
"progressbarImgPos"
:
{
"alias"
:
"进度条的位置"
,
"type"
:
"array<number>"
,
"default"
:
"-
443
,4"
"default"
:
"-
335
,4"
},
"teaStarImgPos"
:
{
"alias"
:
"小茶叶的位置"
,
...
...
@@ -84,6 +94,12 @@
}
},
"assets"
:
[
{
"name"
:
"前景"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/1da0ea14267ff35f90f49c22deb1b34181571e90.png"
,
"uuid"
:
"9f5db57e-47f9-43e5-af80-adf41299280d"
,
"ext"
:
".png"
},
{
"name"
:
"气泡框"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/585743f25262b6992ac97015e22d91054d506821.png"
,
...
...
@@ -98,7 +114,7 @@
},
{
"name"
:
"进度"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
047218962662ed238192f211719c109fa107e8e1
.png"
,
"url"
:
"//yun.duiba.com.cn/aurora/assets/
afb6b2655838ea955d250663fc535cc166b466e7
.png"
,
"uuid"
:
"23e7861c-75a9-46bd-93f8-2825d4810d31"
,
"ext"
:
".png"
},
...
...
@@ -190,22 +206,25 @@
"events"
:
{
"in"
:
{
"event-getchange-TeaNum"
:
{
"alias"
:
"茶叶数量{初始值
totalNum,总量nowNum
} "
"alias"
:
"茶叶数量{初始值
nowNum,总量totalNum,后端时间serverData
} "
},
"event-getBasket-Type"
:
{
"alias"
:
"获得篮子类型"
"alias"
:
"获得篮子类型
(纸 布 竹 木)0 1 2 3
"
},
"event-hand-grasp"
:
{
"alias"
:
"手抓去"
},
"event-getClick-person"
:
{
"alias"
:
"点击人物"
}
},
"out"
:
{
"event-setchange-TeaNum"
:
{
"alias"
:
""
,
"alias"
:
"
获取茶叶数量{初始值nowNum,总量totalNum,后端时间serverData}
"
,
"data"
:
{}
},
"event-setBasket-Typ"
:
{
"alias"
:
""
,
"alias"
:
"
获得篮子类型(纸 布 竹 木)0 1 2 3
"
,
"data"
:
{}
}
}
...
...
src/custom/pick-tea/src/game/GameView.ts
View file @
57aa8bf6
This diff is collapsed.
Click to expand it.
src/custom/pick-tea/src/game/GameWrapper.ts
View file @
57aa8bf6
...
...
@@ -32,12 +32,12 @@ export class GameWrapper extends engine.Container {
engine
.
globalEvent
.
addEventListener
(
'event-pickTeaGame-init'
,
this
.
reset
,
this
);
engine
.
globalEvent
.
addEventListener
(
'event-hand-grasp'
,
this
.
handGrasp
,
this
);
engine
.
globalEvent
.
addEventListener
(
'event-getClick-person'
,
this
.
clickPerson
,
this
);
engine
.
globalEvent
.
addEventListener
(
'event-getchange-TeaNum'
,
this
.
setTeaNum
,
this
);
engine
.
globalEvent
.
addEventListener
(
'event-getBasket-Type'
,
this
.
setPickTeaLevel
,
this
);
let
gameView
=
this
.
_gameView
=
new
GameView
();
this
.
addChild
(
gameView
);
}
...
...
@@ -53,7 +53,14 @@ export class GameWrapper extends engine.Container {
injectProps
(
event
.
data
);
this
.
_gameView
.
setPickTeaLevel
(
event
.
data
);
}
handGrasp
()
{
this
.
_gameView
.
handGrasp
();
}
//点击人物
clickPerson
()
{
this
.
_gameView
.
showVerse
();
}
reset
(
event
:
engine
.
Event
)
{
injectProps
(
event
.
data
);
this
.
_gameView
.
visible
=
true
;
...
...
@@ -83,9 +90,6 @@ export class GameWrapper extends engine.Container {
this
.
_gameView
.
visible
=
false
;
}
handGrasp
()
{
this
.
_gameView
.
handGrasp
();
}
...
...
src/custom/pick-tea/src/game/utils.ts
View file @
57aa8bf6
/**
* Created by rockyl on 2020-01-21.
*/
const
showlog
=
false
;
export
function
getTexture
(
uuid
)
{
return
engine
.
Texture
.
from
(
getAssetByUUID
(
uuid
).
uuid
);
}
...
...
@@ -11,10 +11,20 @@ export function getTextureByName(name) {
}
export
function
playSound
(
name
)
{
engine
.
playSound
(
engine
.
getAssetByName
(
name
).
uuid
,
{
keep
:
true
});
engine
.
playSound
(
engine
.
getAssetByName
(
name
).
uuid
,
{
keep
:
true
});
}
export
function
createSvga
(
name
,
anchorName
?)
{
let
inst
=
new
svga
.
Svga
();
inst
.
source
=
'asset://'
+
engine
.
getAssetByName
(
name
).
uuid
;
return
inst
;
}
export
function
showLog
(
abjname
,
obj
?)
{
if
(
showlog
)
{
console
.
log
(
abjname
)
if
(
obj
)
console
.
log
(
obj
)
}
// let inst = new svga.Svga();
// inst.source = 'asset://' + engine.getAssetByName(name).uuid;
// return inst;
}
\ No newline at end of file
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