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
8cb78db7
Commit
8cb78db7
authored
Sep 05, 2021
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0905
parent
e9a9bef4
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
3809 deletions
+77
-3809
package.json
package.json
+1
-1
ResJson.ts
src/ResJson.ts
+17
-3778
GameOverPanel.ts
src/panels/GameOverPanel.ts
+17
-0
PrizeShowPanel.ts
src/panels/PrizeShowPanel.ts
+4
-4
GameOverScene.ts
src/scenes/GameOverScene/GameOverScene.ts
+20
-16
DeviceMotion.ts
src/scenes/GameScene/DeviceMotion.ts
+1
-1
GameScene.ts
src/scenes/GameScene/GameScene.ts
+17
-9
No files found.
package.json
View file @
8cb78db7
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
"upload"
:
"node scripts/upload"
,
"upload"
:
"node scripts/upload"
,
"build"
:
"npm run handleRes && node scripts/mergeJson && npm run upload && npm run buildTS"
,
"build"
:
"npm run handleRes && node scripts/mergeJson && npm run upload && npm run buildTS"
,
"watch"
:
"webpack --watch"
,
"watch"
:
"webpack --watch"
,
"dev"
:
"node scripts/devServer -p
8099
"
,
"dev"
:
"node scripts/devServer -p
9011
"
,
"dev1"
:
"webpack-dev-server --open --config webpack.dev.js --host 0.0.0.0"
,
"dev1"
:
"webpack-dev-server --open --config webpack.dev.js --host 0.0.0.0"
,
"buildTS"
:
"webpack --config webpack.prod.js && node scripts/mergeJs"
,
"buildTS"
:
"webpack --config webpack.prod.js && node scripts/mergeJs"
,
"copyJs"
:
"node scripts/copyJs"
,
"copyJs"
:
"node scripts/copyJs"
,
...
...
src/ResJson.ts
View file @
8cb78db7
This diff is collapsed.
Click to expand it.
src/panels/GameOverPanel.ts
View file @
8cb78db7
...
@@ -120,6 +120,15 @@ export class GameOverPanel extends Panel {
...
@@ -120,6 +120,15 @@ export class GameOverPanel extends Panel {
this
.
drawBtn
.
startAniRange
(
110
,
this
.
drawBtn
.
totalFrames
,
1
)
this
.
drawBtn
.
startAniRange
(
110
,
this
.
drawBtn
.
totalFrames
,
1
)
await
sleep
(
2000
)
await
sleep
(
2000
)
if
(
!
this
.
data
.
isWinPrize
)
{
this
.
hidePanel
()
// @ts-ignore
my
&&
my
.
showToast
({
content
:
'很遗憾,您未中奖'
})
changeScene
(
GameOverScene
,
this
.
data
)
return
}
const
{
data
,
success
}
=
await
sendTbNet
(
TbNetName
.
drawLotteryPrize
,
{
const
{
data
,
success
}
=
await
sendTbNet
(
TbNetName
.
drawLotteryPrize
,
{
id
:
Tools
.
globalData
.
startId
id
:
Tools
.
globalData
.
startId
})
})
...
@@ -138,6 +147,14 @@ export class GameOverPanel extends Panel {
...
@@ -138,6 +147,14 @@ export class GameOverPanel extends Panel {
})
})
changeScene
(
GameOverScene
,
this
.
data
)
changeScene
(
GameOverScene
,
this
.
data
)
}
}
}
else
{
// 默认错误就 很遗憾吧
this
.
hidePanel
()
// @ts-ignore
my
&&
my
.
showToast
({
content
:
'很遗憾,您未中奖'
})
changeScene
(
GameOverScene
,
this
.
data
)
}
}
},
1
),
this
)
},
1
),
this
)
}
}
...
...
src/panels/PrizeShowPanel.ts
View file @
8cb78db7
...
@@ -24,10 +24,10 @@ export class PrizeShowPanel extends Panel {
...
@@ -24,10 +24,10 @@ export class PrizeShowPanel extends Panel {
preview
.
width
=
300
preview
.
width
=
300
preview
.
height
=
300
preview
.
height
=
300
preview
.
position
.
set
(
150
,
236
)
preview
.
position
.
set
(
150
,
236
)
//
preview.mask = panelCtn.addChild(new FYGE.Graphics())
preview
.
mask
=
panelCtn
.
addChild
(
new
FYGE
.
Graphics
())
//
.beginFill()
.
beginFill
()
//
.drawRoundedRect(150, 236, 300, 300, 20)
.
drawRoundedRect
(
150
,
236
,
300
,
300
,
20
)
//
.endFill()
.
endFill
()
UI
.
Btn
(
panelCtn
,
'confirm-btn.png'
,
function
()
{
UI
.
Btn
(
panelCtn
,
'confirm-btn.png'
,
function
()
{
this
.
btnDelay
(
this
)
this
.
btnDelay
(
this
)
...
...
src/scenes/GameOverScene/GameOverScene.ts
View file @
8cb78db7
...
@@ -78,6 +78,7 @@ export class GameOverScene extends Scene {
...
@@ -78,6 +78,7 @@ export class GameOverScene extends Scene {
},
this
)
},
this
)
_s
.
anchorTexture
.
set
(
0.5
,
0.5
)
_s
.
anchorTexture
.
set
(
0.5
,
0.5
)
if
(
this
.
data
.
productLink
)
{
var
bottomCont
=
UI
.
Ctn
(
this
)
var
bottomCont
=
UI
.
Ctn
(
this
)
bottomCont
.
position
.
set
(
0
,
layers
.
stageOffsetY
+
layers
.
stageHeight
-
130
+
layers
.
stageOffsetY
-
90
)
bottomCont
.
position
.
set
(
0
,
layers
.
stageOffsetY
+
layers
.
stageHeight
-
130
+
layers
.
stageOffsetY
-
90
)
var
isJordan
=
Tools
.
globalData
.
shopId
==
10003
var
isJordan
=
Tools
.
globalData
.
shopId
==
10003
...
@@ -96,6 +97,9 @@ export class GameOverScene extends Scene {
...
@@ -96,6 +97,9 @@ export class GameOverScene extends Scene {
},
this
)
},
this
)
}
}
}
showNumberUp
()
{
showNumberUp
()
{
var
o
=
{
_score
:
0
}
var
o
=
{
_score
:
0
}
var
bitmapTextCount
=
this
.
bitmapTextCount
var
bitmapTextCount
=
this
.
bitmapTextCount
...
...
src/scenes/GameScene/DeviceMotion.ts
View file @
8cb78db7
...
@@ -36,6 +36,7 @@ class DeviceMotion {
...
@@ -36,6 +36,7 @@ class DeviceMotion {
if
(
my
)
{
if
(
my
)
{
const
{
platform
}
=
await
getSystemInfo
()
const
{
platform
}
=
await
getSystemInfo
()
this
.
platform
=
platform
.
toLowerCase
()
this
.
platform
=
platform
.
toLowerCase
()
this
.
_tmdremoveEvents
()
//@ts-ignore
//@ts-ignore
my
.
onDeviceMotionChange
((
res
)
=>
{
my
.
onDeviceMotionChange
((
res
)
=>
{
// 通过 platform 进行判断当前是 弧度制还是 角度值
// 通过 platform 进行判断当前是 弧度制还是 角度值
...
@@ -73,7 +74,6 @@ class DeviceMotion {
...
@@ -73,7 +74,6 @@ class DeviceMotion {
}
}
destory
()
{
destory
()
{
this
.
_tmdremoveEvents
()
this
.
subs
=
[]
this
.
subs
=
[]
DeviceMotion
.
_instance
=
null
DeviceMotion
.
_instance
=
null
}
}
...
...
src/scenes/GameScene/GameScene.ts
View file @
8cb78db7
...
@@ -102,10 +102,11 @@ class RandomArray {
...
@@ -102,10 +102,11 @@ class RandomArray {
}
}
getRandomValue
()
{
getRandomValue
()
{
if
(
this
.
len
==
0
)
{
if
(
!
this
.
arr
.
length
)
{
this
.
arr
=
this
.
iarr
this
.
arr
=
[...
this
.
iarr
]
}
}
var
i
=
Math
.
floor
(
Math
.
random
()
*
this
.
len
)
var
len
=
this
.
arr
.
length
var
i
=
Math
.
floor
(
Math
.
random
()
*
len
)
var
value
=
this
.
arr
[
i
]
var
value
=
this
.
arr
[
i
]
this
.
arr
.
splice
(
i
,
1
)
this
.
arr
.
splice
(
i
,
1
)
return
value
return
value
...
@@ -214,8 +215,8 @@ export class GameScene extends MotionInitScene {
...
@@ -214,8 +215,8 @@ export class GameScene extends MotionInitScene {
async
onSubmit
(
params
)
{
async
onSubmit
(
params
)
{
const
{
data
,
success
,
message
}
=
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
,
level
}
=
data
if
(
isWinPrize
)
{
if
(
level
!=
0
)
{
//@ts-ignore
//@ts-ignore
my
&&
my
.
vibrateShort
()
my
&&
my
.
vibrateShort
()
...
@@ -225,10 +226,17 @@ export class GameScene extends MotionInitScene {
...
@@ -225,10 +226,17 @@ export class GameScene extends MotionInitScene {
}
}
}
else
{
}
else
{
//@ts-ignore
//@ts-ignore
my
&&
my
.
showToast
({
var
fakeData
=
{
content
:
message
score
:
this
.
score
,
});
level
:
[
10
,
20
,
30
].
findIndex
(
i
=>
this
.
score
>=
i
),
sendTbNet
(
TbNetName
.
navigateBack
)
fake
:
true
,
isWinPrize
:
false
}
if
(
fakeData
.
level
!=
-
1
)
{
showPanel
(
GameOverPanel
,
fakeData
)
return
}
changeScene
(
GameOverScene
,
fakeData
)
}
}
}
}
...
...
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