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
540aa936
Commit
540aa936
authored
Sep 28, 2021
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
youxi
parent
068af7ad
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
94 additions
and
87 deletions
+94
-87
panelCtrl.ts
module/ctrls/panelCtrl.ts
+2
-2
centerCircle.png
resource/common/centerCircle.png
+0
-0
跳过按钮.png
resource/common/跳过按钮.png
+0
-0
res.json
resource/res.json
+1
-1
ResJson.ts
src/ResJson.ts
+59
-59
GameOverScene.ts
src/scenes/GameOverScene/GameOverScene.ts
+2
-2
DeviceMotion.ts
src/scenes/GameScene/DeviceMotion.ts
+16
-12
GameScene.ts
src/scenes/GameScene/GameScene.ts
+2
-2
MotionInit.ts
src/scenes/GameScene/MotionInit.ts
+12
-9
No files found.
module/ctrls/panelCtrl.ts
View file @
540aa936
...
...
@@ -13,7 +13,7 @@ export default class PanelCtrl {
/**
* 半透明黑色背景
*/
private
_bg
:
FYGE
.
Shape
;
//FYGE.Graphics;
private
_bg
:
FYGE
.
Graphics
;
//FYGE.Graphics;
/**
* 所有的弹框
*/
...
...
@@ -26,7 +26,7 @@ export default class PanelCtrl {
init
(
parent
:
FYGE
.
Container
)
{
this
.
_parent
=
parent
;
let
bg
=
new
FYGE
.
Shape
();
//Graphics()//Shape();
let
bg
=
new
FYGE
.
Graphics
();
//Graphics()//Shape();
bg
.
beginFill
(
0
);
bg
.
drawRect
(
//引用适配
layers
.
stageOffsetX
-
parent
.
x
,
...
...
resource/common/centerCircle.png
0 → 100644
View file @
540aa936
7.43 KB
resource/common/跳过按钮.png
deleted
100644 → 0
View file @
068af7ad
2.07 KB
resource/res.json
View file @
540aa936
...
...
@@ -33,7 +33,7 @@
"name"
:
"blank_shoe"
},
{
"keys"
:
"c
omCloseBtn.png,com_light.png,count-start.png,count1.png,count2.png,count3.png,jordan-icon.png,music-off.png,music-on.png,nike-icon.png,percennt0.png,percennt1.png,percennt2.png,percennt3.png,percennt4.png,percennt5.png,percennt6.png,percennt7.png,percennt8.png,percennt9.png,percenntp.png,ruready.png,toastBg.png,waitingBg.png,waitingRot.png,跳过按钮
.png"
,
"keys"
:
"c
enterCircle.png,comCloseBtn.png,com_light.png,count-start.png,count1.png,count2.png,count3.png,jordan-icon.png,music-off.png,music-on.png,nike-icon.png,percennt0.png,percennt1.png,percennt2.png,percennt3.png,percennt4.png,percennt5.png,percennt6.png,percennt7.png,percennt8.png,percennt9.png,percenntp.png,ruready.png,toastBg.png,waitingBg.png,waitingRot
.png"
,
"name"
:
"common"
},
{
...
...
src/ResJson.ts
View file @
540aa936
...
...
@@ -1622,7 +1622,7 @@ export const ResJson = {
}
},
{
"keys"
:
"c
omCloseBtn.png,com_light.png,count-start.png,count1.png,count2.png,count3.png,jordan-icon.png,music-off.png,music-on.png,nike-icon.png,percennt0.png,percennt1.png,percennt2.png,percennt3.png,percennt4.png,percennt5.png,percennt6.png,percennt7.png,percennt8.png,percennt9.png,percenntp.png,ruready.png,toastBg.png,waitingBg.png,waitingRot.png,跳过按钮
.png"
,
"keys"
:
"c
enterCircle.png,comCloseBtn.png,com_light.png,count-start.png,count1.png,count2.png,count3.png,jordan-icon.png,music-off.png,music-on.png,nike-icon.png,percennt0.png,percennt1.png,percennt2.png,percennt3.png,percennt4.png,percennt5.png,percennt6.png,percennt7.png,percennt8.png,percennt9.png,percenntp.png,ruready.png,toastBg.png,waitingBg.png,waitingRot
.png"
,
"name"
:
"common"
,
"atlas"
:
{
"com_light.png"
:
{
...
...
@@ -1636,16 +1636,27 @@ export const ResJson = {
"sh"
:
756
,
"ro"
:
false
},
"
toastBg
.png"
:
{
"
centerCircle
.png"
:
{
"x"
:
750
,
"y"
:
2
,
"w"
:
540
,
"h"
:
540
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
540
,
"sh"
:
540
,
"ro"
:
false
},
"toastBg.png"
:
{
"x"
:
750
,
"y"
:
544
,
"w"
:
460
,
"h"
:
130
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
460
,
"sh"
:
130
,
"ro"
:
tru
e
"ro"
:
fals
e
},
"count-start.png"
:
{
"x"
:
2
,
...
...
@@ -1703,8 +1714,8 @@ export const ResJson = {
"ro"
:
false
},
"count1.png"
:
{
"x"
:
776
,
"y"
:
46
4
,
"x"
:
1212
,
"y"
:
54
4
,
"w"
:
56
,
"h"
:
145
,
"ox"
:
0
,
...
...
@@ -1714,30 +1725,19 @@ export const ResJson = {
"ro"
:
false
},
"nike-icon.png"
:
{
"x"
:
834
,
"y"
:
464
,
"x"
:
750
,
"y"
:
691
,
"w"
:
138
,
"h"
:
46
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
138
,
"sh"
:
46
,
"ro"
:
true
},
"跳过按钮.png"
:
{
"x"
:
750
,
"y"
:
611
,
"w"
:
123
,
"h"
:
57
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
123
,
"sh"
:
57
,
"ro"
:
false
},
"comCloseBtn.png"
:
{
"x"
:
7
50
,
"y"
:
670
,
"x"
:
7
76
,
"y"
:
739
,
"w"
:
72
,
"h"
:
72
,
"ox"
:
0
,
...
...
@@ -1748,18 +1748,18 @@ export const ResJson = {
},
"jordan-icon.png"
:
{
"x"
:
776
,
"y"
:
744
,
"y"
:
813
,
"w"
:
71
,
"h"
:
65
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
71
,
"sh"
:
65
,
"ro"
:
fals
e
"ro"
:
tru
e
},
"music-off.png"
:
{
"x"
:
776
,
"y"
:
81
1
,
"x"
:
843
,
"y"
:
81
3
,
"w"
:
60
,
"h"
:
60
,
"ox"
:
0
,
...
...
@@ -1769,8 +1769,8 @@ export const ResJson = {
"ro"
:
false
},
"music-on.png"
:
{
"x"
:
8
82
,
"y"
:
2
,
"x"
:
8
50
,
"y"
:
739
,
"w"
:
60
,
"h"
:
60
,
"ox"
:
0
,
...
...
@@ -1780,8 +1780,8 @@ export const ResJson = {
"ro"
:
false
},
"percenntp.png"
:
{
"x"
:
8
82
,
"y"
:
64
,
"x"
:
8
43
,
"y"
:
875
,
"w"
:
53
,
"h"
:
59
,
"ox"
:
0
,
...
...
@@ -1791,8 +1791,8 @@ export const ResJson = {
"ro"
:
true
},
"percennt0.png"
:
{
"x"
:
882
,
"y"
:
119
,
"x"
:
776
,
"y"
:
886
,
"w"
:
40
,
"h"
:
57
,
"ox"
:
0
,
...
...
@@ -1802,19 +1802,19 @@ export const ResJson = {
"ro"
:
true
},
"percennt3.png"
:
{
"x"
:
8
82
,
"y"
:
161
,
"x"
:
8
90
,
"y"
:
676
,
"w"
:
37
,
"h"
:
57
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
37
,
"sh"
:
57
,
"ro"
:
tru
e
"ro"
:
fals
e
},
"percennt8.png"
:
{
"x"
:
882
,
"y"
:
200
,
"x"
:
904
,
"y"
:
875
,
"w"
:
38
,
"h"
:
57
,
"ox"
:
0
,
...
...
@@ -1824,52 +1824,52 @@ export const ResJson = {
"ro"
:
true
},
"percennt2.png"
:
{
"x"
:
882
,
"y"
:
240
,
"x"
:
905
,
"y"
:
801
,
"w"
:
39
,
"h"
:
56
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
39
,
"sh"
:
56
,
"ro"
:
tru
e
"ro"
:
fals
e
},
"percennt5.png"
:
{
"x"
:
88
2
,
"y"
:
281
,
"x"
:
91
2
,
"y"
:
735
,
"w"
:
37
,
"h"
:
56
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
37
,
"sh"
:
56
,
"ro"
:
tru
e
"ro"
:
fals
e
},
"percennt6.png"
:
{
"x"
:
882
,
"y"
:
320
,
"x"
:
929
,
"y"
:
676
,
"w"
:
38
,
"h"
:
56
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
38
,
"sh"
:
56
,
"ro"
:
tru
e
"ro"
:
fals
e
},
"percennt9.png"
:
{
"x"
:
882
,
"y"
:
360
,
"x"
:
946
,
"y"
:
793
,
"w"
:
38
,
"h"
:
56
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
38
,
"sh"
:
56
,
"ro"
:
tru
e
"ro"
:
fals
e
},
"waitingRot.png"
:
{
"x"
:
882
,
"y"
:
400
,
"x"
:
951
,
"y"
:
734
,
"w"
:
56
,
"h"
:
56
,
"ox"
:
0
,
...
...
@@ -1879,37 +1879,37 @@ export const ResJson = {
"ro"
:
false
},
"percennt1.png"
:
{
"x"
:
77
6
,
"y"
:
8
73
,
"x"
:
94
6
,
"y"
:
8
51
,
"w"
:
22
,
"h"
:
55
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
22
,
"sh"
:
55
,
"ro"
:
fals
e
"ro"
:
tru
e
},
"percennt4.png"
:
{
"x"
:
800
,
"y"
:
873
,
"x"
:
969
,
"y"
:
691
,
"w"
:
40
,
"h"
:
55
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
40
,
"sh"
:
55
,
"ro"
:
fals
e
"ro"
:
tru
e
},
"percennt7.png"
:
{
"x"
:
882
,
"y"
:
458
,
"x"
:
986
,
"y"
:
792
,
"w"
:
41
,
"h"
:
55
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
41
,
"sh"
:
55
,
"ro"
:
tru
e
"ro"
:
fals
e
}
}
},
...
...
@@ -3826,5 +3826,5 @@ export const ResJson = {
}
}
],
"path"
:
"https://yun.duiba.com.cn/db_games/activity/template/163
1206618
/resource/"
"path"
:
"https://yun.duiba.com.cn/db_games/activity/template/163
2799529
/resource/"
}
\ No newline at end of file
src/scenes/GameOverScene/GameOverScene.ts
View file @
540aa936
...
...
@@ -21,9 +21,9 @@ 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
+
218
+
layers
.
stageOffsetY
)
icon
.
position
.
set
(
41
,
layers
.
stageOffsetY
-
90
+
50
+
layers
.
stageOffsetY
)
}
else
{
icon
.
position
.
set
(
41
,
layers
.
stageOffsetY
-
90
+
168
+
layers
.
stageOffsetY
)
icon
.
position
.
set
(
41
,
layers
.
stageOffsetY
-
90
+
0
+
layers
.
stageOffsetY
)
}
this
.
y
-=
layers
.
stageOffsetY
-
90
...
...
src/scenes/GameScene/DeviceMotion.ts
View file @
540aa936
...
...
@@ -36,19 +36,23 @@ class DeviceMotion {
if
(
my
)
{
const
{
platform
}
=
await
getSystemInfo
()
this
.
platform
=
platform
.
toLowerCase
()
// @ts-ignore
my
&&
my
.
onDeviceMotionChange
()
this
.
_tmdremoveEvents
()
//@ts-ignore
my
.
onDeviceMotionChange
((
res
)
=>
{
// 通过 platform 进行判断当前是 弧度制还是 角度值
if
(
this
.
platform
!=
'android'
)
{
res
.
alpha
=
res
.
alpha
/
180
*
Math
.
PI
res
.
beta
=
res
.
beta
/
180
*
Math
.
PI
res
.
gamma
=
res
.
gamma
/
180
*
Math
.
PI
}
else
{
res
.
beta
=
-
res
.
beta
}
this
.
orientationHandler
(
res
)
})
setTimeout
(()
=>
{
//@ts-ignore
my
.
onDeviceMotionChange
((
res
)
=>
{
// 通过 platform 进行判断当前是 弧度制还是 角度值
if
(
this
.
platform
!=
'android'
)
{
res
.
alpha
=
res
.
alpha
/
180
*
Math
.
PI
res
.
beta
=
res
.
beta
/
180
*
Math
.
PI
res
.
gamma
=
res
.
gamma
/
180
*
Math
.
PI
}
else
{
res
.
beta
=
-
res
.
beta
}
this
.
orientationHandler
(
res
)
})
},
300
)
}
else
{
window
.
addEventListener
(
'deviceorientation'
,
(
event
)
=>
{
var
res
=
{
...
...
src/scenes/GameScene/GameScene.ts
View file @
540aa936
...
...
@@ -153,7 +153,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
+
(
getApp
().
isLarge
?
250
:
1
50
))
this
.
scoreText
=
UI
.
Txt
(
this
,
'连续完成: '
+
n
,
40
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
CENTER
,
layers
.
stageWidth
,
-
8
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
(
250
-
168
)
:
50
))
this
.
scoreText
.
mouseEnable
=
false
}
this
.
scoreText
.
text
=
'连续完成: '
+
n
...
...
@@ -200,7 +200,7 @@ export class GameScene extends MotionInitScene {
})
})
cdp
.
position
.
set
(
layers
.
stageCenterX
-
65
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
340
:
240
))
cdp
.
position
.
set
(
layers
.
stageCenterX
-
65
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
340
-
168
:
240
-
168
))
}
...
...
src/scenes/GameScene/MotionInit.ts
View file @
540aa936
...
...
@@ -308,14 +308,14 @@ export class MotionInitScene extends Scene {
set
musicBoolean
(
m
:
boolean
)
{
if
(
m
)
{
(
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
||
(
this
.
musicBtn
=
UI
.
Btn
(
this
,
'music-on.png'
,
this
.
onMusicClick
,
this
,
650
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
52
:
0
)))).
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
+
(
getApp
().
isLarge
?
220
:
168
)))).
texture
=
RES
.
getRes
(
'music-off.png'
);
(
this
.
musicBtn
||
(
this
.
musicBtn
=
UI
.
Btn
(
this
,
'music-on.png'
,
this
.
onMusicClick
,
this
,
650
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
52
:
168
)))).
texture
=
RES
.
getRes
(
'music-off.png'
);
FYGE
.
Tween
.
removeTweens
(
this
.
musicBtn
)
this
.
musicBtn
.
rotation
=
0
}
...
...
@@ -339,13 +339,16 @@ export class MotionInitScene extends Scene {
initUi
()
{
UI
.
Rect
(
this
,
750
,
1624
,
0xf1ebdd
,
0
,
0
,
0
)
var
app
=
getApp
()
UI
.
Sp
(
this
,
app
.
isNike
?
'nike-icon.png'
:
'jordan-icon.png'
,
41
,
app
.
isLarge
?
218
+
layers
.
stageOffsetY
:
168
+
layers
.
stageOffsetY
)
UI
.
Sp
(
this
,
app
.
isNike
?
'nike-icon.png'
:
'jordan-icon.png'
,
41
,
app
.
isLarge
?
50
+
layers
.
stageOffsetY
:
0
+
layers
.
stageOffsetY
)
// 中间的小圆
var
c
=
this
.
addChild
(
new
FYGE
.
Shape
())
.
beginFill
(
0xf0e4ce
)
.
arc
(
layers
.
stageCenterX
,
layers
.
stageCenterY
,
270
,
0
,
2
*
Math
.
PI
)
.
endFill
()
// var c = this.addChild(new FYGE.Shape())
// .beginFill(0xf0e4ce)
// .arc(layers.stageCenterX, layers.stageCenterY, 270, 0, 2*Math.PI)
// .endFill()
UI
.
Sp
(
this
,
'centerCircle.png'
,
layers
.
stageCenterX
,
layers
.
stageCenterY
).
anchorTexture
.
set
(.
5
,
.
5
)
// @ts-ignore
this
.
focusProgress
=
this
.
addChild
(
new
CircleProgressBar
({
...
...
@@ -367,7 +370,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
+
(
getApp
().
isLarge
?
340
:
240
),
true
)
this
.
holdOnTxt
=
UI
.
Txt
(
this
,
'保持住!'
,
60
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
CENTER
,
layers
.
stageWidth
,
30
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
340
-
168
:
240
-
168
),
true
)
this
.
holdOnTxt
.
visible
=
false
this
.
holdOnTxt
.
anchorX
=
layers
.
stageWidth
/
2
this
.
holdOnTxt
.
anchorY
=
30
...
...
@@ -491,7 +494,7 @@ export class MotionInitScene extends Scene {
}
FYGE
.
Tween
.
removeTweens
(
this
.
holdOnTxt
)
this
.
holdOnTxt
.
position
.
set
(
30
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
340
:
240
))
// 重新设置一下
this
.
holdOnTxt
.
position
.
set
(
30
,
layers
.
stageOffsetY
+
(
getApp
().
isLarge
?
340
-
168
:
240
-
168
))
// 重新设置一下
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