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
10f1dc9d
Commit
10f1dc9d
authored
Aug 16, 2021
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
背景音乐添加
parent
5342f43c
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1498 additions
and
22 deletions
+1498
-22
getAppData.json
mock/miniTb/mine/getAppData.json
+2
-1
openMusic.json
mock/miniTb/mine/openMusic.json
+3
-0
music-off.png
resource/common/music-off.png
+0
-0
music-on.png
resource/common/music-on.png
+0
-0
res.json
resource/res.json
+1
-1
ResJson.ts
src/ResJson.ts
+1448
-11
GameOverPanel.ts
src/panels/GameOverPanel.ts
+1
-1
GameOverScene.ts
src/scenes/GameOverScene/GameOverScene.ts
+2
-2
GameScene.ts
src/scenes/GameScene/GameScene.ts
+38
-3
NewGuyScene.ts
src/scenes/NewGuyScene/NewGuyScene.ts
+3
-3
No files found.
mock/miniTb/mine/getAppData.json
View file @
10f1dc9d
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
"firstLoginToday"
:
true
,
"firstLoginToday"
:
true
,
"newUser"
:
false
,
"newUser"
:
false
,
"shop"
:
"FUSION"
,
"shop"
:
"FUSION"
,
"shopId"
:
10004
"shopId"
:
10004
,
"completed"
:
true
}
}
}
}
mock/miniTb/mine/openMusic.json
0 → 100644
View file @
10f1dc9d
{
"success"
:
true
}
\ No newline at end of file
resource/common/music-off.png
0 → 100644
View file @
10f1dc9d
2.02 KB
resource/common/music-on.png
0 → 100644
View file @
10f1dc9d
1.47 KB
resource/res.json
View file @
10f1dc9d
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
"name"
:
"balance_guidance"
"name"
:
"balance_guidance"
},
},
{
{
"keys"
:
"back.png,back_jordan.png,comCloseBtn.png,com_light.png,toastBg.png,waitingBg.png,waitingRot.png,跳过按钮.png"
,
"keys"
:
"back.png,back_jordan.png,comCloseBtn.png,com_light.png,
music-off.png,music-on.png,
toastBg.png,waitingBg.png,waitingRot.png,跳过按钮.png"
,
"name"
:
"common"
"name"
:
"common"
},
},
{
{
...
...
src/ResJson.ts
View file @
10f1dc9d
This diff is collapsed.
Click to expand it.
src/panels/GameOverPanel.ts
View file @
10f1dc9d
...
@@ -49,7 +49,7 @@ export class GameOverPanel extends Panel {
...
@@ -49,7 +49,7 @@ export class GameOverPanel extends Panel {
this
.
hidePanel
()
this
.
hidePanel
()
// @ts-ignore
// @ts-ignore
my
&&
my
.
showToast
({
my
&&
my
.
showToast
({
content
:
'很遗憾,
谢谢参与
'
content
:
'很遗憾,
您未中奖
'
})
})
changeScene
(
GameOverScene
,
this
.
data
)
changeScene
(
GameOverScene
,
this
.
data
)
}
}
...
...
src/scenes/GameOverScene/GameOverScene.ts
View file @
10f1dc9d
...
@@ -54,8 +54,8 @@ export class GameOverScene extends Scene {
...
@@ -54,8 +54,8 @@ export class GameOverScene extends Scene {
_s
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
function
()
{
_s
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
function
()
{
this
.
btnDelay
(
this
)
this
.
btnDelay
(
this
)
addData
(
8
)
addData
(
8
)
//
todo
//
@ts-ignore
console
.
log
(
'回到主场'
)
my
&&
my
.
exit
(
)
},
this
)
},
this
)
_s
.
anchorTexture
.
set
(
0.5
,
0.5
)
_s
.
anchorTexture
.
set
(
0.5
,
0.5
)
...
...
src/scenes/GameScene/GameScene.ts
View file @
10f1dc9d
...
@@ -12,6 +12,7 @@ import { RES } from '../../../module/RES';
...
@@ -12,6 +12,7 @@ import { RES } from '../../../module/RES';
import
{
sendTbNet
,
TbNetName
}
from
'../../TaoBaoNet'
;
import
{
sendTbNet
,
TbNetName
}
from
'../../TaoBaoNet'
;
import
{
GameOverScene
}
from
'../GameOverScene/GameOverScene'
;
import
{
GameOverScene
}
from
'../GameOverScene/GameOverScene'
;
import
{
GameOverPanel
}
from
'../../panels/GameOverPanel'
;
import
{
GameOverPanel
}
from
'../../panels/GameOverPanel'
;
import
MusicBtn
from
'../../common/MusicBtn'
;
const
Container
=
FYGE
.
Container
const
Container
=
FYGE
.
Container
const
TEXT_ALIGN
=
FYGE
.
TEXT_ALIGN
const
TEXT_ALIGN
=
FYGE
.
TEXT_ALIGN
...
@@ -114,15 +115,28 @@ export class GameScene extends MotionInitScene {
...
@@ -114,15 +115,28 @@ export class GameScene extends MotionInitScene {
set
score
(
n
:
number
)
{
set
score
(
n
:
number
)
{
this
.
_score
=
n
;
this
.
_score
=
n
;
(
this
.
scoreText
||
(
this
.
scoreText
=
UI
.
Txt
(
this
,
'连续完成: '
+
n
,
40
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
CENTER
,
layers
.
stageWidth
,
0
,
layers
.
stageOffsetY
+
200
,
true
))).
text
=
'连续完成: '
+
n
if
(
!
this
.
scoreText
)
{
this
.
scoreText
=
UI
.
Txt
(
this
,
'连续完成: '
+
n
,
40
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
CENTER
,
layers
.
stageWidth
,
0
,
layers
.
stageOffsetY
+
200
,
true
)
this
.
scoreText
.
mouseEnable
=
false
}
this
.
scoreText
.
text
=
'连续完成: '
+
n
}
}
get
score
()
{
get
score
()
{
return
this
.
_score
return
this
.
_score
}
}
musicStatus
:
boolean
=
true
musicBtn
:
FYGE
.
Button
async
initUi
()
{
async
initUi
()
{
UI
.
Sp
(
this
,
this
.
isJordan
?
'back_jordan.png'
:
'back.png'
)
UI
.
Sp
(
this
,
this
.
isJordan
?
'back_jordan.png'
:
'back.png'
)
this
.
musicBtn
=
UI
.
Btn
(
this
,
'music-on.png'
,
this
.
onMusicClick
,
this
,
600
,
layers
.
stageOffsetY
+
200
)
FYGE
.
Tween
.
get
(
this
.
musicBtn
,
{
loop
:
true
})
.
to
({
rotation
:
360
},
5000
)
this
.
musicBtn
.
anchorX
=
30
this
.
musicBtn
.
anchorY
=
30
this
.
score
=
0
this
.
score
=
0
...
@@ -133,6 +147,10 @@ export class GameScene extends MotionInitScene {
...
@@ -133,6 +147,10 @@ export class GameScene extends MotionInitScene {
DeviceMotion
.
instance
.
destory
()
DeviceMotion
.
instance
.
destory
()
this
.
gameEle
&&
this
.
gameEle
.
freeze
()
this
.
gameEle
&&
this
.
gameEle
.
freeze
()
FYGE
.
Tween
.
removeAllTweens
()
FYGE
.
Tween
.
removeAllTweens
()
// 关闭背景
sendTbNet
(
TbNetName
.
openMusic
,
{
isOn
:
false
})
//@ts-ignore
//@ts-ignore
this
.
onSubmit
({
this
.
onSubmit
({
id
:
Tools
.
globalData
.
startId
,
id
:
Tools
.
globalData
.
startId
,
...
@@ -144,6 +162,21 @@ export class GameScene extends MotionInitScene {
...
@@ -144,6 +162,21 @@ export class GameScene extends MotionInitScene {
super
.
initUi
()
super
.
initUi
()
}
}
onMusicClick
()
{
this
.
musicStatus
=
!
this
.
musicStatus
this
.
musicBtn
.
changeTexture
(
this
.
musicStatus
?
RES
.
getRes
(
'music-on.png'
)
:
RES
.
getRes
(
'music-off.png'
))
if
(
this
.
musicStatus
)
{
FYGE
.
Tween
.
get
(
this
.
musicBtn
,
{
loop
:
true
})
.
to
({
rotation
:
360
},
5000
)
}
else
{
FYGE
.
Tween
.
removeTweens
(
this
.
musicBtn
)
this
.
musicBtn
.
rotation
=
0
}
sendTbNet
(
TbNetName
.
openMusic
,
{
isOn
:
this
.
musicStatus
})
}
initGame
()
{
initGame
()
{
this
.
cdp
.
start
()
this
.
cdp
.
start
()
...
@@ -182,8 +215,11 @@ export class GameScene extends MotionInitScene {
...
@@ -182,8 +215,11 @@ export class GameScene extends MotionInitScene {
this
.
cdp
.
start
()
this
.
cdp
.
start
()
}
}
descText
:
FYGE
.
TextField
initEvents
()
{
initEvents
()
{
DeviceMotion
.
instance
.
notify
((
res
)
=>
{
(
this
.
descText
||
(
this
.
descText
=
UI
.
Txt
(
this
,
`alpha:
${
res
.
alpha
.
toFixed
(
2
)}
, beta:
${
res
.
beta
.
toFixed
(
2
)}
, gamma:
${
res
.
gamma
.
toFixed
(
2
)}
`
,
32
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
CENTER
,
layers
.
stageWidth
,
0
,
layers
.
stageOffsetY
+
100
))).
text
=
`alpha:
${
res
.
alpha
.
toFixed
(
2
)}
, beta:
${
res
.
beta
.
toFixed
(
2
)}
, gamma:
${
res
.
gamma
.
toFixed
(
2
)}
`
})
}
}
removeEvents
()
{
removeEvents
()
{
...
@@ -201,7 +237,6 @@ export class GameEle extends Container {
...
@@ -201,7 +237,6 @@ export class GameEle extends Container {
resisteAcc
:
number
=
GameCfg
.
resisteAcc
// 摩擦力加速度
resisteAcc
:
number
=
GameCfg
.
resisteAcc
// 摩擦力加速度
k
:
number
// 旋转角度和和中心点距离的系数
k
:
number
// 旋转角度和和中心点距离的系数
isIn
:
boolean
// 是否在中心范围内
isIn
:
boolean
// 是否在中心范围内
lastLen
:
number
// 上一次的距离
fixedCenter
:
pos
// 判断点坐标
fixedCenter
:
pos
// 判断点坐标
finishFunc
:
Function
// success callback
finishFunc
:
Function
// success callback
...
...
src/scenes/NewGuyScene/NewGuyScene.ts
View file @
10f1dc9d
...
@@ -38,8 +38,8 @@ export class NewGuyScene extends MotionInitScene {
...
@@ -38,8 +38,8 @@ export class NewGuyScene extends MotionInitScene {
g1
:
FYGE
.
Sprite
g1
:
FYGE
.
Sprite
initGame
()
{
initGame
()
{
this
.
g1
=
UI
.
Sp
(
this
,
'guidance-t1.png'
,
layers
.
stageCenterX
,
layers
.
stageCenterY
+
400
)
//
this.g1 = UI.Sp(this, 'guidance-t1.png', layers.stageCenterX, layers.stageCenterY + 400)
this
.
g1
.
anchorTexture
.
set
(
0.5
,
0.5
)
//
this.g1.anchorTexture.set(0.5, 0.5)
var
e
=
this
.
addChild
(
new
GameEle
(
'p1.png'
,
this
.
centerp
,
async
()
=>
{
var
e
=
this
.
addChild
(
new
GameEle
(
'p1.png'
,
this
.
centerp
,
async
()
=>
{
const
{
success
}
=
await
sendTbNet
(
TbNetName
.
complteGuidance
)
const
{
success
}
=
await
sendTbNet
(
TbNetName
.
complteGuidance
)
...
@@ -48,7 +48,7 @@ export class NewGuyScene extends MotionInitScene {
...
@@ -48,7 +48,7 @@ export class NewGuyScene extends MotionInitScene {
}
}
shoot
()
{
shoot
()
{
this
.
g1
.
visible
=
false
this
.
g1
&&
(
this
.
g1
.
visible
=
false
)
this
.
desc
&&
(
this
.
desc
.
visible
=
false
)
this
.
desc
&&
(
this
.
desc
.
visible
=
false
)
}
}
...
...
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