Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
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
wildfirecode13
new_taobao
Commits
5e08e4d3
Commit
5e08e4d3
authored
Sep 22, 2020
by
Edwise
🍷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1234
parent
6c928df7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
15 deletions
+51
-15
tmallCat.getUserInfo.json
...ect/src/canvas/game/mock/miniTb/tmallCat.getUserInfo.json
+2
-2
waitingCtrl.ts
project/src/canvas/game/module/ctrls/waitingCtrl.ts
+1
-1
resCanvasList.js
project/src/canvas/game/resCanvasList.js
+6
-0
Cat.ts
project/src/canvas/game/src/cat/Cat.ts
+34
-7
RulePanel.ts
project/src/canvas/game/src/panels/RulePanel.ts
+2
-0
MainScene.ts
project/src/canvas/game/src/scenes/MainScene.ts
+2
-2
MainSceneBtnUi.ts
project/src/canvas/game/src/ui/MainSceneBtnUi.ts
+4
-3
No files found.
project/src/canvas/game/mock/miniTb/tmallCat.getUserInfo.json
View file @
5e08e4d3
...
...
@@ -2,9 +2,9 @@
"success"
:
true
,
"message"
:
""
,
"data"
:
{
"catType"
:
1
,
"catType"
:
2
,
"userNick"
:
"Edwise"
,
"energy"
:
100
0
,
"energy"
:
100
,
"happyCoin"
:
1000
,
"experience"
:
50
,
"level"
:
"1"
,
...
...
project/src/canvas/game/module/ctrls/waitingCtrl.ts
View file @
5e08e4d3
...
...
@@ -91,7 +91,7 @@ class Waiting extends FYGE.Container {
}
show
(
msg
:
string
=
"加载中"
)
{
this
.
msg
.
text
=
msg
;
//
this.msg.text = msg;
}
destroy
()
{
...
...
project/src/canvas/game/resCanvasList.js
View file @
5e08e4d3
...
...
@@ -652,6 +652,12 @@ const resCanvasList = {
ext
:
'.png'
,
url
:
'https://yun.duiba.com.cn/spark/assets/LetterTexture.78192e79fa3b21a85b245038f23561eeb5141d4d.png'
,
uuid
:
'3b12798d-d932-4f5b-a442-6e4877ba5c16'
},
'624e8c63-963f-4b20-9802-b0fb006fbf93'
:
{
name
:
'catTalkDialog'
,
ext
:
'.png'
,
url
:
'//yun.duiba.com.cn/spark/assets/catTalkDialog.6fa85b0929d7d8e0d42d0d30587cdbdc33059a8f.png'
,
uuid
:
'624e8c63-963f-4b20-9802-b0fb006fbf93'
}
};
export
default
resCanvasList
;
project/src/canvas/game/src/cat/Cat.ts
View file @
5e08e4d3
...
...
@@ -44,12 +44,15 @@ export class Cat extends Module {
catAnimArr
:
FYGE
.
Lottie
[]
=
[];
//猫咪lottie实例组
catLottieArr
:
any
//猫咪lottie数据组
actRunning
:
boolean
=
false
;
//动效是否进行中,如果动效进行中,无法进行其他动效
dialog
:
FYGE
.
Sprite
;
//猫咪对话框气泡
dialogText
:
FYGE
.
TextField
;
//猫咪对话框气泡文字内容
initUi
()
{
this
.
initCatLottieArr
();
console
.
log
(
this
.
catLottieArr
);
this
.
initCat
();
this
.
setCatAnimShow
(
0
);
this
.
initDialog
();
this
.
setCatAnimShow
(
1
);
this
.
initEvents
();
}
...
...
@@ -66,7 +69,7 @@ export class Cat extends Module {
},
"orenge"
:
{
sleep
:
jumao01
,
talk
:
jumaoshu
mao
,
talk
:
jumaoshu
ohua
,
clear
:
jumaoshumao
,
rua
:
jumaolumao04
,
play
:
jumaowanshua
,
...
...
@@ -119,7 +122,31 @@ export class Cat extends Module {
that
.
catAnimArr
.
push
(
that
.
cat_touch
);
}
curAnim
:
number
=
0
;
/**初始化对话框 */
initDialog
(){
var
that
=
this
;
that
.
dialog
=
Ins
.
initSprite
(
"624e8c63-963f-4b20-9802-b0fb006fbf93"
);
that
.
dialog
.
position
.
set
(
280
,
526
)
that
.
addChild
(
that
.
dialog
);
that
.
dialogText
=
Ins
.
initLabel
({
size
:
24
,
x
:
30
,
y
:
20
});
that
.
dialogText
.
textWidth
=
280
;
that
.
dialog
.
addChild
(
that
.
dialogText
);
that
.
dialogText
.
text
=
"哈哈哈哈哈哈哈哈哈哈哈
\n
哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈"
;
console
.
log
(
"最大长度为"
+
that
.
dialogText
.
text
.
length
)
that
.
dialog
.
visible
=
false
;
}
/**显示对话框 */
showDialog
(
msg
:
string
){
this
.
dialogText
.
text
=
msg
;
this
.
dialog
.
visible
=
true
;
}
/**隐藏对话框 */
hideDialog
(){
this
.
dialog
.
visible
=
false
;
}
/**根据index显示猫咪动画
* 0:睡觉,1:说话,2:梳毛,3:撸猫,4:玩球,5:摸头
*/
...
...
@@ -156,17 +183,17 @@ export class Cat extends Module {
case
CAT_ACTTYPEP
.
SLEEP
:
break
;
default
:
that
.
setCatAnimShow
(
actType
,
()
=>
{
that
.
setCatAnimShow
(
0
,
null
)
});
that
.
setCatAnimShow
(
actType
,
()
=>
{
that
.
hideDialog
();
that
.
setCatAnimShow
(
0
,
null
)
});
break
;
}
}
else
{
// FYGE.GDispatcher.dispatchEvent("23",r.message)
showToast
(
r
.
message
)
}
})
}
initEvents
()
{
...
...
project/src/canvas/game/src/panels/RulePanel.ts
View file @
5e08e4d3
...
...
@@ -13,6 +13,8 @@ export class RulePanel extends Panel{
this
.
y
=
(
Ins
.
stageH
-
bg
.
height
)
>>
1
;
var
ruleLabel
=
Ins
.
initLabel
({
size
:
24
,
text
:
"规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则规则"
})
var
ruleView
=
new
FYGE
.
ScrollPage
(
574
,
279
,
ruleLabel
.
textHeight
)
ruleLabel
.
textWidth
=
570
;
// ruleLabel.
ruleView
.
isSpringBack
=
false
;
ruleView
.
x
=
76
;
ruleView
.
y
=
167
;
...
...
project/src/canvas/game/src/scenes/MainScene.ts
View file @
5e08e4d3
...
...
@@ -78,7 +78,7 @@ export class MainScene extends Scene {
/**初始化猫咪 */
initCat
()
{
var
that
=
this
;
that
.
cat
=
new
Cat
({
type
:
"
xianluo
"
});
that
.
cat
=
new
Cat
({
type
:
"
orenge
"
});
that
.
addChild
(
that
.
cat
);
if
(
Ins
.
catIsOut
)
{
that
.
cat
.
visible
=
false
;
...
...
@@ -141,7 +141,7 @@ export class MainScene extends Scene {
var
that
=
this
;
that
.
energy
=
Ins
.
userInfo
.
energy
;
that
.
energyImg
.
scaleX
=
(
that
.
energy
/
that
.
maxEnergy
);
that
.
energyDeco
.
x
=
that
.
energyImgW
*
that
.
energyImg
.
scaleX
-
that
.
energyDeco
.
width
*
0.
5
;
that
.
energyDeco
.
x
=
that
.
energyImgW
*
that
.
energyImg
.
scaleX
-
that
.
energyDeco
.
width
*
0.
2
;
that
.
energyLabel
.
text
=
"精力"
+
that
.
energy
+
"/"
+
that
.
maxEnergy
;
that
.
energyLabel
.
x
=
(
that
.
energyGroup
.
width
-
that
.
energyLabel
.
textWidth
)
/
2
}
...
...
project/src/canvas/game/src/ui/MainSceneBtnUi.ts
View file @
5e08e4d3
...
...
@@ -43,6 +43,7 @@ export class MainSceneBtnUi extends Module {
private
catAvatar
:
FYGE
.
Sprite
;
//猫猫头像
private
catNameLabel
:
FYGE
.
TextField
;
//猫猫名称文本
private
catLevelLabel
:
FYGE
.
TextField
;
//猫猫等级文本
private
catExperience
:
FYGE
.
TextField
;
//经验值文本
/**鱼鱼积分组 */
private
fishPointGroup
:
FYGE
.
Sprite
;
private
fishPointLabel
:
FYGE
.
TextField
;
//鱼鱼积分文本
...
...
@@ -101,10 +102,8 @@ export class MainSceneBtnUi extends Module {
var
mask
=
new
FYGE
.
Shape
();
mask
.
beginFill
(
6
,
1
);
mask
.
drawCircle
(
0
,
0
,
24
)
// mask.drawRoundedRect(0, 0, 52, 52, 38, 38, 38, 38);
mask
.
endFill
();
mask
.
x
=
33
;
mask
.
y
=
33
;
mask
.
position
.
set
(
33
,
33
)
that
.
catInfoGroup
.
addChild
(
mask
);
that
.
catAvatar
.
mask
=
mask
;
...
...
@@ -113,6 +112,8 @@ export class MainSceneBtnUi extends Module {
that
.
catLevelLabel
=
Ins
.
initLabel
({
color
:
"black"
,
size
:
24
,
text
:
"Lv.1"
,
x
:
(
192
-
19
),
y
:
(
167
-
145
)
})
that
.
catInfoGroup
.
addChild
(
that
.
catLevelLabel
);
// that.catLevelLabel
}
/**初始化鱼鱼积分组 */
...
...
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