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
1c5772e1
Commit
1c5772e1
authored
Aug 12, 2021
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
方连点
parent
58a746b7
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
967 additions
and
24 deletions
+967
-24
ResJson.ts
src/ResJson.ts
+932
-7
CountDownComp.ts
src/components/CountDownComp.ts
+8
-0
GameOverPanel.ts
src/panels/GameOverPanel.ts
+12
-11
PrizeShowPanel.ts
src/panels/PrizeShowPanel.ts
+1
-0
GameOverScene.ts
src/scenes/GameOverScene/GameOverScene.ts
+6
-3
GameScene.ts
src/scenes/GameScene/GameScene.ts
+8
-3
No files found.
src/ResJson.ts
View file @
1c5772e1
This diff is collapsed.
Click to expand it.
src/components/CountDownComp.ts
View file @
1c5772e1
...
@@ -97,4 +97,12 @@ export default class CountDownComp extends Module {
...
@@ -97,4 +97,12 @@ export default class CountDownComp extends Module {
}
}
destory
()
{
this
.
stop
()
this
.
timeoutFn
.
length
=
0
super
.
destroy
()
}
}
}
\ No newline at end of file
src/panels/GameOverPanel.ts
View file @
1c5772e1
...
@@ -36,17 +36,18 @@ export class GameOverPanel extends Panel {
...
@@ -36,17 +36,18 @@ export class GameOverPanel extends Panel {
var
icon
=
UI
.
Sp
(
panelCtn
,
'prize-icon1.png'
,
panelCtn
.
width
/
2
,
580
)
var
icon
=
UI
.
Sp
(
panelCtn
,
'prize-icon1.png'
,
panelCtn
.
width
/
2
,
580
)
icon
.
anchorTexture
.
set
(
0.5
,
0.5
)
icon
.
anchorTexture
.
set
(
0.5
,
0.5
)
icon
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
async
function
()
{
icon
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
async
function
()
{
const
{
data
,
success
}
=
await
sendTbNet
(
TbNetName
.
drawLotteryPrize
)
this
.
btnDelay
(
this
)
if
(
success
)
{
const
{
data
,
success
}
=
await
sendTbNet
(
TbNetName
.
drawLotteryPrize
)
if
(
data
.
type
!=
5
)
{
if
(
success
)
{
// 中奖了
if
(
data
.
type
!=
5
)
{
this
.
hidePanel
()
// 中奖了
showPanel
(
PrizeShowPanel
,
Object
.
assign
({},
data
,
this
.
data
)
)
this
.
hidePanel
(
)
}
else
{
showPanel
(
PrizeShowPanel
,
Object
.
assign
({},
data
,
this
.
data
))
this
.
hidePanel
()
}
else
{
changeScene
(
GameOverScene
,
this
.
data
)
this
.
hidePanel
(
)
}
changeScene
(
GameOverScene
,
this
.
data
)
}
}
},
this
)
}
},
this
)
}
}
}
}
\ No newline at end of file
src/panels/PrizeShowPanel.ts
View file @
1c5772e1
...
@@ -27,6 +27,7 @@ export class PrizeShowPanel extends Panel {
...
@@ -27,6 +27,7 @@ export class PrizeShowPanel extends Panel {
.
endFill
()
.
endFill
()
UI
.
Btn
(
panelCtn
,
'confirm-btn.png'
,
function
()
{
UI
.
Btn
(
panelCtn
,
'confirm-btn.png'
,
function
()
{
this
.
btnDelay
(
this
)
if
(
this
.
data
.
type
==
3
)
{
if
(
this
.
data
.
type
==
3
)
{
this
.
hidePanel
()
this
.
hidePanel
()
changeScene
(
GameOverScene
,
this
.
data
)
changeScene
(
GameOverScene
,
this
.
data
)
...
...
src/scenes/GameOverScene/GameOverScene.ts
View file @
1c5772e1
...
@@ -36,17 +36,19 @@ export class GameOverScene extends Scene {
...
@@ -36,17 +36,19 @@ export class GameOverScene extends Scene {
},
this
,
45
,
950
)
},
this
,
45
,
950
)
UI
.
Btn
(
this
,
'more-btn.png'
,
function
()
{
UI
.
Btn
(
this
,
'more-btn.png'
,
function
()
{
this
.
btnDelay
(
this
)
// @ts-ignore
// @ts-ignore
my
.
re
directTo
({
my
.
re
Launch
({
url
:
'/pages/mainscene/mainscene'
url
:
'/pages/mainscene/mainscene'
})
})
},
this
,
45
,
1110
)
},
this
,
45
,
1110
)
var
_s
=
UI
.
Sp
(
this
,
'back-home.png'
,
layers
.
stageCenterX
,
1350
)
var
_s
=
UI
.
Sp
(
this
,
'back-home.png'
,
layers
.
stageCenterX
,
1350
)
_s
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
function
()
{
_s
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
function
()
{
this
.
btnDelay
(
this
)
// todo
// todo
console
.
log
(
'回到主场'
)
console
.
log
(
'回到主场'
)
})
}
,
this
)
_s
.
anchorTexture
.
set
(
0.5
,
0.5
)
_s
.
anchorTexture
.
set
(
0.5
,
0.5
)
var
bottomCont
=
UI
.
Ctn
(
this
)
var
bottomCont
=
UI
.
Ctn
(
this
)
...
@@ -57,10 +59,11 @@ export class GameOverScene extends Scene {
...
@@ -57,10 +59,11 @@ export class GameOverScene extends Scene {
UI
.
Txt
(
bottomCont
,
'让你的体态更加健康'
,
26
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
LEFT
,
500
,
160
,
75
)
UI
.
Txt
(
bottomCont
,
'让你的体态更加健康'
,
26
,
'#111111'
,
FYGE
.
TEXT_ALIGN
.
LEFT
,
500
,
160
,
75
)
UI
.
Sp
(
bottomCont
,
'jump-icon.png'
,
600
,
40
)
UI
.
Sp
(
bottomCont
,
'jump-icon.png'
,
600
,
40
)
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
function
()
{
.
addEventListener
(
FYGE
.
MouseEvent
.
CLICK
,
function
()
{
this
.
btnDelay
(
this
)
// @ts-ignore
// @ts-ignore
// my.
// my.
console
.
log
(
this
.
data
.
productLink
)
console
.
log
(
this
.
data
.
productLink
)
})
}
,
this
)
}
}
}
}
\ No newline at end of file
src/scenes/GameScene/GameScene.ts
View file @
1c5772e1
...
@@ -100,8 +100,7 @@ export class GameScene extends MotionInitScene {
...
@@ -100,8 +100,7 @@ export class GameScene extends MotionInitScene {
var
cdp
=
this
.
cdp
=
this
.
addChild
(
new
CountDownComp
(
GameCfg
.
iTime
))
var
cdp
=
this
.
cdp
=
this
.
addChild
(
new
CountDownComp
(
GameCfg
.
iTime
))
this
.
cdp
.
addTimeoutFunc
(()
=>
{
this
.
cdp
.
addTimeoutFunc
(()
=>
{
this
.
cdp
.
visible
=
false
this
.
cdp
.
destory
()
// 销毁 instance
// 销毁 instance
DeviceMotion
.
instance
.
destory
()
DeviceMotion
.
instance
.
destory
()
//@ts-ignore
//@ts-ignore
...
@@ -128,7 +127,7 @@ export class GameScene extends MotionInitScene {
...
@@ -128,7 +127,7 @@ export class GameScene extends MotionInitScene {
}
}
async
onSubmit
(
params
)
{
async
onSubmit
(
params
)
{
const
{
data
,
success
}
=
await
sendTbNet
(
TbNetName
.
submitGame
,
params
)
const
{
data
,
success
,
message
}
=
await
sendTbNet
(
TbNetName
.
submitGame
,
params
)
if
(
success
)
{
if
(
success
)
{
const
{
score
,
isNewRecord
,
productLink
,
isWinPrize
}
=
data
const
{
score
,
isNewRecord
,
productLink
,
isWinPrize
}
=
data
if
(
isWinPrize
)
{
if
(
isWinPrize
)
{
...
@@ -146,6 +145,12 @@ export class GameScene extends MotionInitScene {
...
@@ -146,6 +145,12 @@ export class GameScene extends MotionInitScene {
isWinPrize
isWinPrize
})
})
}
}
}
else
{
//@ts-ignore
my
&&
my
.
showToast
({
content
:
message
});
sendTbNet
(
TbNetName
.
navigateBack
)
}
}
}
}
...
...
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