Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tb_project
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
钱根
tb_project
Commits
713825e8
Commit
713825e8
authored
Aug 30, 2021
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小机型简单适配
parent
f7ae4da7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
24 deletions
+27
-24
getAppData.json
mock/miniTb/mine/getAppData.json
+1
-1
submitGame.json
mock/miniTb/yoga/submitGame.json
+2
-2
ResJson.ts
src/ResJson.ts
+1
-1
GameOverScene.ts
src/scenes/GameOverScene/GameOverScene.ts
+12
-10
GameScene.ts
src/scenes/GameScene/GameScene.ts
+4
-4
MotionInit.ts
src/scenes/GameScene/MotionInit.ts
+7
-6
No files found.
mock/miniTb/mine/getAppData.json
View file @
713825e8
...
...
@@ -12,7 +12,7 @@
"newUser"
:
false
,
"shop"
:
"FUSION"
,
"shopId"
:
10004
,
"completed"
:
fals
e
"completed"
:
tru
e
}
}
mock/miniTb/yoga/submitGame.json
View file @
713825e8
{
"data"
:
{
"id"
:
666666
,
"score"
:
233
,
"score"
:
1
,
"isNewRecord"
:
false
,
"productLink"
:
"http://qnpic.top/yoona2"
,
"isWinPrize"
:
tru
e
,
"isWinPrize"
:
fals
e
,
"level"
:
"2"
},
"success"
:
true
,
...
...
src/ResJson.ts
View file @
713825e8
...
...
@@ -3826,5 +3826,5 @@ export const ResJson = {
}
}
],
"path"
:
"https://yun.duiba.com.cn/db_games/activity/template/16299
62165
/resource/"
"path"
:
"https://yun.duiba.com.cn/db_games/activity/template/16299
79469
/resource/"
}
\ No newline at end of file
src/scenes/GameOverScene/GameOverScene.ts
View file @
713825e8
...
...
@@ -21,29 +21,31 @@ export class GameOverScene extends Scene {
UI
.
Rect
(
this
,
750
,
1624
,
0xf1ebdd
,
0
,
0
,
0
)
var
icon
=
UI
.
Sp
(
this
,
getApp
().
isNike
?
'nike-icon.png'
:
'jordan-icon.png'
,
41
,
220
)
if
(
getApp
().
isLarge
)
{
icon
.
position
.
set
(
41
,
-
layers
.
stageOffsetY
+
90
+
1624
-
layers
.
stage
.
viewRect
.
height
+
68
)
icon
.
position
.
set
(
41
,
layers
.
stageOffsetY
-
90
+
218
+
layers
.
stageOffsetY
)
}
else
{
icon
.
position
.
set
(
41
,
-
layers
.
stageOffsetY
+
90
+
1624
-
layers
.
stage
.
viewRect
.
height
+
98
)
icon
.
position
.
set
(
41
,
layers
.
stageOffsetY
-
90
+
168
+
layers
.
stageOffsetY
)
}
this
.
y
-=
layers
.
stageOffsetY
-
90
console
.
log
(
this
.
data
)
var
bitMapc
=
Tools
.
getNumTextures
(
'num'
)
var
bitMapc2
=
Tools
.
getNumTextures
(
'numb'
)
var
bitmapTextCount
=
this
.
bitmapTextCount
=
this
.
addChild
(
new
FYGE
.
BitmapText
(
bitMapc
))
if
(
this
.
data
.
score
<=
3
)
{
this
.
bitmapTextCount
.
textures
=
bitMapc2
}
else
{
if
(
!
this
.
data
.
hideMusic
)
{
}
if
(
!
this
.
data
.
hideMusic
)
{
if
(
this
.
data
.
score
>
3
)
{
await
sendTbNet
(
TbNetName
.
openMusic
,
{
isOn
:
true
,
kurl
:
TBBgm
.
scoreBgm
,
loop
:
false
},
null
,
null
,
true
)
}
this
.
showNumberUp
()
}
}
this
.
showNumberUp
()
}
this
.
bitmapTextCount
.
position
.
set
(
layers
.
stageCenterX
,
500
)
// this.bitmapTextCount.text = this.data.score + ''
bitmapTextCount
.
text
=
'0'
...
...
@@ -81,8 +83,8 @@ export class GameOverScene extends Scene {
var
isJordan
=
Tools
.
globalData
.
shopId
==
10003
UI
.
Rect
(
bottomCont
,
layers
.
stageWidth
,
130
,
0xffffff
)
UI
.
Sp
(
bottomCont
,
'product-link__icon.png'
,
50
,
25
)
UI
.
Txt
(
bottomCont
,
`
${
isJordan
?
'Jordan
'
:
'Nike'
}
瑜伽商品
`
,
24
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
LEFT
,
500
,
160
,
40
,
true
)
UI
.
Txt
(
bottomCont
,
'让你的体态更加健康'
,
22
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
LEFT
,
500
,
160
,
70
,
true
)
UI
.
Txt
(
bottomCont
,
`
${
isJordan
?
'Jordan
女子商品'
:
'Nike瑜伽商品'
}
`
,
24
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
LEFT
,
500
,
160
,
40
,
true
)
UI
.
Txt
(
bottomCont
,
`
${
isJordan
?
'让你充满活力和灵感'
:
'让你的体态更加健康'
}
`
,
22
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
LEFT
,
500
,
160
,
70
,
true
)
UI
.
Sp
(
bottomCont
,
'jump-icon.png'
,
600
,
40
)
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
function
()
{
this
.
btnDelay
(
this
)
...
...
src/scenes/GameScene/GameScene.ts
View file @
713825e8
...
...
@@ -118,7 +118,7 @@ export class GameScene extends MotionInitScene {
set
score
(
n
:
number
)
{
this
.
_score
=
n
;
if
(
!
this
.
scoreText
)
{
this
.
scoreText
=
UI
.
Txt
(
this
,
'连续完成: '
+
n
,
40
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
CENTER
,
layers
.
stageWidth
,
-
8
,
layers
.
stageOffsetY
+
250
)
this
.
scoreText
=
UI
.
Txt
(
this
,
'连续完成: '
+
n
,
40
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
CENTER
,
layers
.
stageWidth
,
-
8
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
250
:
150
)
)
this
.
scoreText
.
mouseEnable
=
false
}
this
.
scoreText
.
text
=
'连续完成: '
+
n
...
...
@@ -137,14 +137,14 @@ export class GameScene extends MotionInitScene {
set
musicBoolean
(
m
:
boolean
)
{
if
(
m
)
{
(
this
.
musicBtn
||
(
this
.
musicBtn
=
UI
.
Btn
(
this
,
'music-on.png'
,
this
.
onMusicClick
,
this
,
650
,
layers
.
stageOffsetY
+
220
))).
texture
=
RES
.
getRes
(
'music-on.png'
);
(
this
.
musicBtn
||
(
this
.
musicBtn
=
UI
.
Btn
(
this
,
'music-on.png'
,
this
.
onMusicClick
,
this
,
650
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
220
:
168
)
))).
texture
=
RES
.
getRes
(
'music-on.png'
);
this
.
musicBtn
.
anchorX
=
30
this
.
musicBtn
.
anchorY
=
30
FYGE
.
Tween
.
get
(
this
.
musicBtn
,
{
loop
:
true
})
.
to
({
rotation
:
360
},
5000
)
}
else
{
(
this
.
musicBtn
||
(
this
.
musicBtn
=
UI
.
Btn
(
this
,
'music-on.png'
,
this
.
onMusicClick
,
this
,
650
,
layers
.
stageOffsetY
+
220
))).
texture
=
RES
.
getRes
(
'music-off.png'
);
(
this
.
musicBtn
||
(
this
.
musicBtn
=
UI
.
Btn
(
this
,
'music-on.png'
,
this
.
onMusicClick
,
this
,
650
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
220
:
168
)
))).
texture
=
RES
.
getRes
(
'music-off.png'
);
FYGE
.
Tween
.
removeTweens
(
this
.
musicBtn
)
this
.
musicBtn
.
rotation
=
0
}
...
...
@@ -186,7 +186,7 @@ export class GameScene extends MotionInitScene {
})
})
cdp
.
position
.
set
(
layers
.
stageCenterX
-
65
,
layers
.
stageOffsetY
+
340
)
cdp
.
position
.
set
(
layers
.
stageCenterX
-
65
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
340
:
240
)
)
}
...
...
src/scenes/GameScene/MotionInit.ts
View file @
713825e8
...
...
@@ -254,9 +254,9 @@ export class MotionInitFunc extends Container {
if
(
this
.
timer
==
null
)
{
this
.
timer
=
FYGE
.
Tween
.
get
(
this
.
progress
,
{
onChange
:
()
=>
{
if
(
this
.
progress
.
value
>
0.9
)
{
this
.
guidanceFill
()
}
//
if (this.progress.value > 0.9) {
//
this.guidanceFill()
//
}
}
})
.
to
({
value
:
1
},
1500
)
...
...
@@ -299,7 +299,8 @@ export class MotionInitScene extends Scene {
initUi
()
{
UI
.
Rect
(
this
,
750
,
1624
,
0xf1ebdd
,
0
,
0
,
0
)
UI
.
Sp
(
this
,
getApp
().
isNike
?
'nike-icon.png'
:
'jordan-icon.png'
,
41
,
220
)
var
app
=
getApp
()
UI
.
Sp
(
this
,
app
.
isNike
?
'nike-icon.png'
:
'jordan-icon.png'
,
41
,
app
.
isLarge
?
218
+
layers
.
stageOffsetY
:
168
+
layers
.
stageOffsetY
)
// 中间的小圆
var
c
=
this
.
addChild
(
new
FYGE
.
Shape
())
...
...
@@ -327,7 +328,7 @@ export class MotionInitScene extends Scene {
this
.
bitmapTextCount
.
position
.
set
(
layers
.
stageCenterX
,
layers
.
stageCenterY
+
380
)
// @ts-ignore
this
.
holdOnTxt
=
UI
.
Txt
(
this
,
'保持住!'
,
60
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
CENTER
,
layers
.
stageWidth
,
30
,
layers
.
stageOffsetY
+
340
,
true
)
this
.
holdOnTxt
=
UI
.
Txt
(
this
,
'保持住!'
,
60
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
CENTER
,
layers
.
stageWidth
,
30
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
340
:
240
)
,
true
)
this
.
holdOnTxt
.
visible
=
false
this
.
holdOnTxt
.
anchorX
=
layers
.
stageWidth
/
2
this
.
holdOnTxt
.
anchorY
=
30
...
...
@@ -447,7 +448,7 @@ export class MotionInitScene extends Scene {
}
FYGE
.
Tween
.
removeTweens
(
this
.
holdOnTxt
)
this
.
holdOnTxt
.
position
.
set
(
30
,
layers
.
stageOffsetY
+
340
)
// 重新设置一下
this
.
holdOnTxt
.
position
.
set
(
30
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
340
:
240
)
)
// 重新设置一下
this
.
holdOnTxt
.
visible
=
false
// @ts-ignore
...
...
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