Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DuibaGameTemplate
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
钱根
DuibaGameTemplate
Commits
16714916
Commit
16714916
authored
Sep 15, 2021
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0915
parent
a622a43d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
670 deletions
+47
-670
Main.ts
src/Main.ts
+3
-3
ResJson.ts
src/ResJson.ts
+7
-646
SoundWeb.ts
src/SoundWeb.ts
+3
-2
BoomEle.ts
src/components/BoomEle.ts
+3
-4
MoonCake.ts
src/components/MoonCake.ts
+14
-0
GameConfig.ts
src/scenes/GameScene/GameConfig.ts
+6
-5
GameScene.ts
src/scenes/GameScene/GameScene.ts
+11
-10
No files found.
src/Main.ts
View file @
16714916
...
@@ -220,9 +220,9 @@ export class Main {
...
@@ -220,9 +220,9 @@ export class Main {
const
pageCfg
=
Tools
.
PAGE
const
pageCfg
=
Tools
.
PAGE
pageCfg
.
gameDiff
&&
Object
.
assign
(
GameSimCfg
,
{
pageCfg
.
gameDiff
&&
Object
.
assign
(
GameSimCfg
,
{
boomProbability
:
3
0
,
// 炸弹的概率
boomProbability
:
1
0
,
// 炸弹的概率
diffLevel
:
6
,
diffLevel
:
10
,
maxBoomNum
:
3
,
// 一波中最多炸弹数
maxBoomNum
:
2
,
// 一波中最多炸弹数
})
})
var
scene
var
scene
if
(
pageCfg
.
newUser
)
{
if
(
pageCfg
.
newUser
)
{
...
...
src/ResJson.ts
View file @
16714916
...
@@ -2,671 +2,32 @@ export const ResJson = {
...
@@ -2,671 +2,32 @@ export const ResJson = {
"groups"
:
[
"groups"
:
[
{
{
"keys"
:
"boom.png,clock-pointer.png,countdown-back.png"
,
"keys"
:
"boom.png,clock-pointer.png,countdown-back.png"
,
"name"
:
"GameEle"
,
"name"
:
"GameEle"
"atlas"
:
{
"countdown-back.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
145
,
"h"
:
58
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
145
,
"sh"
:
58
,
"ro"
:
false
},
"boom.png"
:
{
"x"
:
2
,
"y"
:
62
,
"w"
:
131
,
"h"
:
124
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
131
,
"sh"
:
124
,
"ro"
:
false
},
"clock-pointer.png"
:
{
"x"
:
135
,
"y"
:
62
,
"w"
:
5
,
"h"
:
17
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
5
,
"sh"
:
17
,
"ro"
:
false
}
}
},
},
{
{
"keys"
:
"GameScene-back.png,GameScene-back2.png,boomScore.png,extra-score.png,extra_scene.png,guidance4-1.png,guidance4-2.png,guidance4-3.png,guidance5-0.png,guidance5-1.png,guidance5-2.png,guidance5-3.png,guidance5-t.png,mission-goal.png,shortcut_icon.png,title-back.png"
,
"keys"
:
"GameScene-back.png,GameScene-back2.png,boomScore.png,extra-score.png,extra_scene.png,guidance4-1.png,guidance4-2.png,guidance4-3.png,guidance5-0.png,guidance5-1.png,guidance5-2.png,guidance5-3.png,guidance5-t.png,mission-goal.png,shortcut_icon.png,title-back.png"
,
"name"
:
"GameScene"
,
"name"
:
"GameScene"
"atlas"
:
{
"GameScene-back.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
1624
,
"h"
:
750
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
1624
,
"sh"
:
750
,
"ro"
:
false
},
"GameScene-back2.png"
:
{
"x"
:
2
,
"y"
:
754
,
"w"
:
1624
,
"h"
:
750
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
1624
,
"sh"
:
750
,
"ro"
:
false
},
"extra_scene.png"
:
{
"x"
:
2
,
"y"
:
1506
,
"w"
:
1624
,
"h"
:
421
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
1624
,
"sh"
:
421
,
"ro"
:
false
},
"guidance4-3.png"
:
{
"x"
:
1628
,
"y"
:
2
,
"w"
:
500
,
"h"
:
45
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
500
,
"sh"
:
45
,
"ro"
:
true
},
"guidance5-0.png"
:
{
"x"
:
1675
,
"y"
:
2
,
"w"
:
264
,
"h"
:
134
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
264
,
"sh"
:
134
,
"ro"
:
true
},
"title-back.png"
:
{
"x"
:
1675
,
"y"
:
268
,
"w"
:
240
,
"h"
:
75
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
240
,
"sh"
:
75
,
"ro"
:
true
},
"guidance5-1.png"
:
{
"x"
:
1752
,
"y"
:
268
,
"w"
:
50
,
"h"
:
206
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
50
,
"sh"
:
206
,
"ro"
:
false
},
"guidance5-3.png"
:
{
"x"
:
1628
,
"y"
:
510
,
"w"
:
139
,
"h"
:
205
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
139
,
"sh"
:
205
,
"ro"
:
false
},
"guidance5-2.png"
:
{
"x"
:
1628
,
"y"
:
717
,
"w"
:
140
,
"h"
:
193
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
140
,
"sh"
:
193
,
"ro"
:
false
},
"mission-goal.png"
:
{
"x"
:
1628
,
"y"
:
912
,
"w"
:
182
,
"h"
:
77
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
182
,
"sh"
:
77
,
"ro"
:
true
},
"guidance4-1.png"
:
{
"x"
:
1628
,
"y"
:
1096
,
"w"
:
175
,
"h"
:
48
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
175
,
"sh"
:
48
,
"ro"
:
false
},
"guidance4-2.png"
:
{
"x"
:
1628
,
"y"
:
1146
,
"w"
:
167
,
"h"
:
86
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
167
,
"sh"
:
86
,
"ro"
:
false
},
"boomScore.png"
:
{
"x"
:
1707
,
"y"
:
912
,
"w"
:
160
,
"h"
:
88
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
160
,
"sh"
:
88
,
"ro"
:
true
},
"extra-score.png"
:
{
"x"
:
1770
,
"y"
:
476
,
"w"
:
104
,
"h"
:
32
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
104
,
"sh"
:
32
,
"ro"
:
true
},
"guidance5-t.png"
:
{
"x"
:
1628
,
"y"
:
1234
,
"w"
:
100
,
"h"
:
53
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
100
,
"sh"
:
53
,
"ro"
:
false
},
"shortcut_icon.png"
:
{
"x"
:
1730
,
"y"
:
1234
,
"w"
:
89
,
"h"
:
48
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
89
,
"sh"
:
48
,
"ro"
:
true
}
}
},
},
{
{
"keys"
:
"guidance1-1.png,guidance1-2.png,guidance1-3.png,guidance2-1.png"
,
"keys"
:
"guidance1-1.png,guidance1-2.png,guidance1-3.png,guidance2-1.png"
,
"name"
:
"Guidance"
,
"name"
:
"Guidance"
"atlas"
:
{
"guidance1-2.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
753
,
"h"
:
42
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
753
,
"sh"
:
42
,
"ro"
:
false
},
"guidance1-3.png"
:
{
"x"
:
2
,
"y"
:
46
,
"w"
:
576
,
"h"
:
45
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
576
,
"sh"
:
45
,
"ro"
:
false
},
"guidance1-1.png"
:
{
"x"
:
2
,
"y"
:
93
,
"w"
:
575
,
"h"
:
46
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
575
,
"sh"
:
46
,
"ro"
:
false
},
"guidance2-1.png"
:
{
"x"
:
2
,
"y"
:
141
,
"w"
:
537
,
"h"
:
45
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
537
,
"sh"
:
45
,
"ro"
:
false
}
}
},
},
{
{
"keys"
:
"_mooncake0-1.png,_mooncake0-2.png,_mooncake0.png,mooncake0-1.png,mooncake0-2.png,mooncake0.png,mooncake1-1.png,mooncake1-2.png,mooncake1.png,mooncake2-1.png,mooncake2-2.png,mooncake2.png,mooncake3-1.png,mooncake3-2.png,mooncake3.png,mooncake4-1.png,mooncake4-2.png,mooncake4.png"
,
"keys"
:
"_mooncake0-1.png,_mooncake0-2.png,_mooncake0.png,mooncake0-1.png,mooncake0-2.png,mooncake0.png,mooncake1-1.png,mooncake1-2.png,mooncake1.png,mooncake2-1.png,mooncake2-2.png,mooncake2.png,mooncake3-1.png,mooncake3-2.png,mooncake3.png,mooncake4-1.png,mooncake4-2.png,mooncake4.png"
,
"name"
:
"MoonCake"
,
"name"
:
"MoonCake"
"atlas"
:
{
"_mooncake0.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
273
,
"h"
:
265
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
273
,
"sh"
:
265
,
"ro"
:
false
},
"_mooncake0-1.png"
:
{
"x"
:
2
,
"y"
:
269
,
"w"
:
217
,
"h"
:
237
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
217
,
"sh"
:
237
,
"ro"
:
true
},
"_mooncake0-2.png"
:
{
"x"
:
277
,
"y"
:
2
,
"w"
:
191
,
"h"
:
207
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
191
,
"sh"
:
207
,
"ro"
:
false
},
"mooncake4-1.png"
:
{
"x"
:
277
,
"y"
:
211
,
"w"
:
150
,
"h"
:
109
,
"ox"
:
14
,
"oy"
:
27
,
"sw"
:
170
,
"sh"
:
170
,
"ro"
:
false
},
"mooncake4.png"
:
{
"x"
:
241
,
"y"
:
322
,
"w"
:
142
,
"h"
:
116
,
"ox"
:
15
,
"oy"
:
27
,
"sw"
:
170
,
"sh"
:
170
,
"ro"
:
true
},
"mooncake0.png"
:
{
"x"
:
470
,
"y"
:
2
,
"w"
:
141
,
"h"
:
132
,
"ox"
:
14
,
"oy"
:
19
,
"sw"
:
170
,
"sh"
:
170
,
"ro"
:
true
},
"mooncake4-2.png"
:
{
"x"
:
470
,
"y"
:
145
,
"w"
:
140
,
"h"
:
111
,
"ox"
:
15
,
"oy"
:
32
,
"sw"
:
170
,
"sh"
:
170
,
"ro"
:
true
},
"mooncake3.png"
:
{
"x"
:
359
,
"y"
:
322
,
"w"
:
138
,
"h"
:
139
,
"ox"
:
13
,
"oy"
:
17
,
"sw"
:
170
,
"sh"
:
170
,
"ro"
:
false
},
"mooncake3-1.png"
:
{
"x"
:
2
,
"y"
:
488
,
"w"
:
137
,
"h"
:
123
,
"ox"
:
13
,
"oy"
:
13
,
"sw"
:
170
,
"sh"
:
170
,
"ro"
:
false
},
"mooncake0-1.png"
:
{
"x"
:
241
,
"y"
:
466
,
"w"
:
136
,
"h"
:
104
,
"ox"
:
17
,
"oy"
:
19
,
"sw"
:
170
,
"sh"
:
170
,
"ro"
:
true
},
"mooncake0-2.png"
:
{
"x"
:
499
,
"y"
:
287
,
"w"
:
123
,
"h"
:
103
,
"ox"
:
17
,
"oy"
:
48
,
"sw"
:
170
,
"sh"
:
170
,
"ro"
:
true
},
"mooncake3-2.png"
:
{
"x"
:
141
,
"y"
:
488
,
"w"
:
118
,
"h"
:
82
,
"ox"
:
31
,
"oy"
:
75
,
"sw"
:
170
,
"sh"
:
170
,
"ro"
:
true
},
"mooncake1.png"
:
{
"x"
:
499
,
"y"
:
412
,
"w"
:
86
,
"h"
:
86
,
"ox"
:
5
,
"oy"
:
4
,
"sw"
:
100
,
"sh"
:
100
,
"ro"
:
false
},
"mooncake2.png"
:
{
"x"
:
347
,
"y"
:
500
,
"w"
:
80
,
"h"
:
71
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
80
,
"sh"
:
71
,
"ro"
:
true
},
"mooncake1-2.png"
:
{
"x"
:
420
,
"y"
:
463
,
"w"
:
77
,
"h"
:
59
,
"ox"
:
12
,
"oy"
:
29
,
"sw"
:
100
,
"sh"
:
100
,
"ro"
:
false
},
"mooncake1-1.png"
:
{
"x"
:
420
,
"y"
:
524
,
"w"
:
75
,
"h"
:
60
,
"ox"
:
5
,
"oy"
:
4
,
"sw"
:
100
,
"sh"
:
100
,
"ro"
:
true
},
"mooncake2-1.png"
:
{
"x"
:
482
,
"y"
:
524
,
"w"
:
69
,
"h"
:
58
,
"ox"
:
0
,
"oy"
:
1
,
"sw"
:
80
,
"sh"
:
71
,
"ro"
:
true
},
"mooncake2-2.png"
:
{
"x"
:
542
,
"y"
:
500
,
"w"
:
67
,
"h"
:
53
,
"ox"
:
13
,
"oy"
:
17
,
"sw"
:
80
,
"sh"
:
71
,
"ro"
:
true
}
}
},
},
{
{
"keys"
:
"num0.png,num1.png,num2.png,num3.png,num4.png,num5.png,num6.png,num7.png,num8.png,num9.png,num_add.png"
,
"keys"
:
"num0.png,num1.png,num2.png,num3.png,num4.png,num5.png,num6.png,num7.png,num8.png,num9.png,num_add.png"
,
"name"
:
"NumberTexture"
,
"name"
:
"NumberTexture"
"atlas"
:
{
"num0.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
62
,
"h"
:
90
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
62
,
"sh"
:
90
,
"ro"
:
false
},
"num2.png"
:
{
"x"
:
66
,
"y"
:
2
,
"w"
:
64
,
"h"
:
90
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
64
,
"sh"
:
90
,
"ro"
:
false
},
"num3.png"
:
{
"x"
:
2
,
"y"
:
94
,
"w"
:
63
,
"h"
:
90
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
63
,
"sh"
:
90
,
"ro"
:
true
},
"num6.png"
:
{
"x"
:
132
,
"y"
:
2
,
"w"
:
62
,
"h"
:
90
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
62
,
"sh"
:
90
,
"ro"
:
false
},
"num8.png"
:
{
"x"
:
94
,
"y"
:
94
,
"w"
:
62
,
"h"
:
90
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
62
,
"sh"
:
90
,
"ro"
:
true
},
"num9.png"
:
{
"x"
:
2
,
"y"
:
159
,
"w"
:
62
,
"h"
:
90
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
62
,
"sh"
:
90
,
"ro"
:
true
},
"num5.png"
:
{
"x"
:
196
,
"y"
:
2
,
"w"
:
64
,
"h"
:
89
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
64
,
"sh"
:
89
,
"ro"
:
false
},
"num1.png"
:
{
"x"
:
94
,
"y"
:
158
,
"w"
:
57
,
"h"
:
88
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
57
,
"sh"
:
88
,
"ro"
:
true
},
"num4.png"
:
{
"x"
:
186
,
"y"
:
94
,
"w"
:
67
,
"h"
:
88
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
67
,
"sh"
:
88
,
"ro"
:
false
},
"num7.png"
:
{
"x"
:
2
,
"y"
:
223
,
"w"
:
62
,
"h"
:
88
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
62
,
"sh"
:
88
,
"ro"
:
true
},
"num_add.png"
:
{
"x"
:
94
,
"y"
:
217
,
"w"
:
64
,
"h"
:
66
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
64
,
"sh"
:
66
,
"ro"
:
false
}
}
},
},
{
{
"keys"
:
"music_btn.png,music_btn_close.png,toastBg.png,waitingBg.png,waitingRot.png"
,
"keys"
:
"music_btn.png,music_btn_close.png,toastBg.png,waitingBg.png,waitingRot.png"
,
"name"
:
"common"
,
"name"
:
"common"
"atlas"
:
{
"toastBg.png"
:
{
"x"
:
2
,
"y"
:
2
,
"w"
:
460
,
"h"
:
130
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
460
,
"sh"
:
130
,
"ro"
:
false
},
"waitingBg.png"
:
{
"x"
:
2
,
"y"
:
134
,
"w"
:
160
,
"h"
:
180
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
160
,
"sh"
:
180
,
"ro"
:
true
},
"music_btn.png"
:
{
"x"
:
184
,
"y"
:
134
,
"w"
:
57
,
"h"
:
57
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
57
,
"sh"
:
57
,
"ro"
:
false
},
"music_btn_close.png"
:
{
"x"
:
184
,
"y"
:
193
,
"w"
:
57
,
"h"
:
57
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
57
,
"sh"
:
57
,
"ro"
:
false
},
"waitingRot.png"
:
{
"x"
:
243
,
"y"
:
134
,
"w"
:
56
,
"h"
:
56
,
"ox"
:
0
,
"oy"
:
0
,
"sw"
:
56
,
"sh"
:
56
,
"ro"
:
false
}
}
},
},
{
{
"keys"
:
"hand_guidance.svga,hand_swing.svga,light.svga,pinkCake.svga,spBtnIcon.svga,spBtnIcon2.svga,spShow.svga"
,
"keys"
:
"hand_guidance.svga,hand_swing.svga,light.svga,pinkCake.svga,spBtnIcon.svga,spBtnIcon2.svga,spShow.svga"
,
"name"
:
"svga"
"name"
:
"svga"
}
}
],
],
"path"
:
"
https://yun.duiba.com.cn/db_games/activity/template/1631598549
/resource/"
"path"
:
"
.
/resource/"
}
}
\ No newline at end of file
src/SoundWeb.ts
View file @
16714916
...
@@ -23,8 +23,9 @@ export const Soundurl = {
...
@@ -23,8 +23,9 @@ export const Soundurl = {
sucess
:
'//yun.duiba.com.cn/spark/assets/b8d82c2e432278dcc4fddfec5c6d585ac7cc5675.mp3'
,
sucess
:
'//yun.duiba.com.cn/spark/assets/b8d82c2e432278dcc4fddfec5c6d585ac7cc5675.mp3'
,
fail
:
'//yun.duiba.com.cn/spark/assets/aa8c3daa5c0717d58649b95216bd27e06ee714da.mp3'
,
fail
:
'//yun.duiba.com.cn/spark/assets/aa8c3daa5c0717d58649b95216bd27e06ee714da.mp3'
,
moonCakeOut
:
'//yun.dui88.com/ec747b63-31d2-45ca-ba5a-6b1b8beefec4.mp3'
,
moonCakeOut
:
'//yun.dui88.com/ec747b63-31d2-45ca-ba5a-6b1b8beefec4.mp3'
,
moonCakeBreak
:
'//yun.dui88.com/592006ed-1e80-4770-9ae5-95cdb47dab05.mp3'
,
moonCakeBreak
:
'//yun.dui88.com/ae73ce3d-1c7c-4dec-81d1-c701bace9b8b.mp3'
,
boomBreak
:
'//yun.dui88.com/25f64850-b5d6-4507-b4df-35252282d2e2.mp3'
boomBreak
:
'//yun.dui88.com/25f64850-b5d6-4507-b4df-35252282d2e2.mp3'
,
blade
:
'//yun.dui88.com/6d1b5f49-00ee-4590-975f-e2080f45ec4c.mp3'
,
// 刀光
}
}
// private sounds = {
// private sounds = {
...
...
src/components/BoomEle.ts
View file @
16714916
...
@@ -22,9 +22,6 @@ export default class BoomEle extends FYGE.Sprite {
...
@@ -22,9 +22,6 @@ export default class BoomEle extends FYGE.Sprite {
this
.
anchorX
=
this
.
width
/
2
this
.
anchorX
=
this
.
width
/
2
this
.
reset
()
this
.
reset
()
FYGE
.
Tween
.
get
(
this
,
{
loop
:
true
})
.
to
({
rotation
:
360
},
5000
)
}
}
initPhyBody
()
{
initPhyBody
()
{
...
@@ -43,7 +40,9 @@ export default class BoomEle extends FYGE.Sprite {
...
@@ -43,7 +40,9 @@ export default class BoomEle extends FYGE.Sprite {
reset
()
{
reset
()
{
this
.
isDie
=
false
this
.
isDie
=
false
// this.initPhyBody()
FYGE
.
Tween
.
get
(
this
,
{
loop
:
true
})
.
to
({
rotation
:
360
},
5000
)
return
this
return
this
}
}
...
...
src/components/MoonCake.ts
View file @
16714916
...
@@ -36,10 +36,24 @@ export default class MoonCake extends FYGE.Sprite {
...
@@ -36,10 +36,24 @@ export default class MoonCake extends FYGE.Sprite {
// 克隆一个纹理
// 克隆一个纹理
this
.
texture
=
RES
.
getRes
(
`mooncake
${
i
}
.png`
).
clone
()
this
.
texture
=
RES
.
getRes
(
`mooncake
${
i
}
.png`
).
clone
()
this
.
texture
.
valid
=
true
this
.
texture
.
valid
=
true
// this.anchorTexture.set(0.5, 0.5)
// this.anchorTexture.set(0.5, 0.5)
this
.
anchorY
=
this
.
height
/
2
this
.
anchorY
=
this
.
height
/
2
this
.
anchorX
=
this
.
width
/
2
this
.
anchorX
=
this
.
width
/
2
this
.
scaleX
=
1
this
.
scaleY
=
1
var
_scale
=
{
0
:
1.2
,
1
:
1.55
,
2
:
1.55
}
if
(
_scale
[
i
])
{
this
.
scaleX
=
_scale
[
i
]
this
.
scaleY
=
_scale
[
i
]
}
this
.
initHalfPart
()
this
.
initHalfPart
()
FYGE
.
Tween
.
get
(
this
,
{
loop
:
true
})
FYGE
.
Tween
.
get
(
this
,
{
loop
:
true
})
...
...
src/scenes/GameScene/GameConfig.ts
View file @
16714916
export
const
GameSimCfg
=
{
export
const
GameSimCfg
=
{
boomProbability
:
10
,
// 炸弹的概率
boomProbability
:
5
,
// 炸弹的概率
diffLevel
:
10
,
diffLevel
:
15
,
levelNum
:
4
,
crazyMaxLen
:
6
,
// crazy time boom's number
crazyMaxLen
:
6
,
// crazy time boom's number
maxBoomNum
:
2
,
// 一波中最多炸弹数
maxBoomNum
:
1
,
// 一波中最多炸弹数
shortCutTime
:
2
00
,
shortCutTime
:
5
00
,
crazyTime
:
10000
,
crazyTime
:
10000
,
isPlayMusic
:
fals
e
,
isPlayMusic
:
tru
e
,
GamingTime
:
70000
,
GamingTime
:
70000
,
fpsScale
:
1
fpsScale
:
1
}
}
\ No newline at end of file
src/scenes/GameScene/GameScene.ts
View file @
16714916
...
@@ -21,6 +21,7 @@ export default class GameScene extends Scene {
...
@@ -21,6 +21,7 @@ export default class GameScene extends Scene {
isOver
:
boolean
=
true
isOver
:
boolean
=
true
gameEles
:
Array
<
MoonCake
|
BoomEle
>
=
[]
gameEles
:
Array
<
MoonCake
|
BoomEle
>
=
[]
maxcakes
:
number
=
GameSimCfg
.
diffLevel
maxcakes
:
number
=
GameSimCfg
.
diffLevel
currLevel
:
number
=
0
// 分成n波
sceneContainer
:
FYGE
.
Container
sceneContainer
:
FYGE
.
Container
blade
:
Blade
blade
:
Blade
currBoomNum
:
number
=
0
currBoomNum
:
number
=
0
...
@@ -48,7 +49,6 @@ export default class GameScene extends Scene {
...
@@ -48,7 +49,6 @@ export default class GameScene extends Scene {
shortCutCnt
:
FYGE
.
Container
// 连击 Container
shortCutCnt
:
FYGE
.
Container
// 连击 Container
shortCutText
:
FYGE
.
BitmapText
shortCutText
:
FYGE
.
BitmapText
moonCakeScore
:
number
=
0
moonCakeScore
:
number
=
0
boomScore
:
number
=
0
shortCutScore
:
number
=
0
shortCutScore
:
number
=
0
set
score
(
n
:
number
)
{
set
score
(
n
:
number
)
{
...
@@ -297,7 +297,8 @@ export default class GameScene extends Scene {
...
@@ -297,7 +297,8 @@ export default class GameScene extends Scene {
*/
*/
gennerateMoonCakes
()
{
gennerateMoonCakes
()
{
if
(
this
.
isOver
)
return
if
(
this
.
isOver
)
return
while
(
this
.
gameEles
.
length
<
this
.
maxcakes
)
{
this
.
currLevel
<
GameSimCfg
.
levelNum
&&
++
this
.
currLevel
while
(
this
.
gameEles
.
length
<
Math
.
floor
(
this
.
maxcakes
*
this
.
currLevel
/
GameSimCfg
.
levelNum
))
{
this
.
initGameEle
()
this
.
initGameEle
()
}
}
}
}
...
@@ -314,7 +315,7 @@ export default class GameScene extends Scene {
...
@@ -314,7 +315,7 @@ export default class GameScene extends Scene {
mc
.
addedToPhyScene
(
randomNum
(
1000
,
4000
),
{
x
:
rx
<
812
?
randomNum
(
3
,
5
)
:
randomNum
(
-
3
,
-
5
),
y
:
-
32
*
k
})
mc
.
addedToPhyScene
(
randomNum
(
1000
,
4000
),
{
x
:
rx
<
812
?
randomNum
(
3
,
5
)
:
randomNum
(
-
3
,
-
5
),
y
:
-
32
*
k
})
mc
.
fx
=
rx
mc
.
fx
=
rx
// 测试
// 测试
mc
.
fy
=
75
0
mc
.
fy
=
80
0
this
.
gameEles
.
push
(
mc
)
this
.
gameEles
.
push
(
mc
)
}
}
...
@@ -356,6 +357,7 @@ export default class GameScene extends Scene {
...
@@ -356,6 +357,7 @@ export default class GameScene extends Scene {
return
return
}
}
}
}
this
.
spIcon
.
play
(
1
)
this
.
gameEles
.
forEach
(
ele
=>
{
this
.
gameEles
.
forEach
(
ele
=>
{
!
ele
.
isFire
&&
(
ele
.
fy
=
layers
.
stageHeight
+
1000
)
!
ele
.
isFire
&&
(
ele
.
fy
=
layers
.
stageHeight
+
1000
)
...
@@ -389,7 +391,7 @@ export default class GameScene extends Scene {
...
@@ -389,7 +391,7 @@ export default class GameScene extends Scene {
x
:
layers
.
stageOffsetX
-
200
,
x
:
layers
.
stageOffsetX
-
200
,
y
:
randomNum
(
layers
.
stageOffsetY
+
100
,
layers
.
stageOffsetY
+
300
)
y
:
randomNum
(
layers
.
stageOffsetY
+
100
,
layers
.
stageOffsetY
+
300
)
},
{
},
{
x
:
randomNum
(
15
,
2
0
),
x
:
randomNum
(
20
,
3
0
),
y
:
randomNum
(
-
4
,
-
10
)
y
:
randomNum
(
-
4
,
-
10
)
}))
}))
}
}
...
@@ -399,7 +401,7 @@ export default class GameScene extends Scene {
...
@@ -399,7 +401,7 @@ export default class GameScene extends Scene {
x
:
layers
.
stageOffsetX
+
layers
.
stageWidth
+
50
,
x
:
layers
.
stageOffsetX
+
layers
.
stageWidth
+
50
,
y
:
randomNum
(
layers
.
stageOffsetY
+
100
,
layers
.
stageOffsetY
+
300
)
y
:
randomNum
(
layers
.
stageOffsetY
+
100
,
layers
.
stageOffsetY
+
300
)
},
{
},
{
x
:
randomNum
(
-
15
,
-
2
0
),
x
:
randomNum
(
-
20
,
-
3
0
),
y
:
randomNum
(
-
4
,
-
10
)
y
:
randomNum
(
-
4
,
-
10
)
}))
}))
}
}
...
@@ -417,7 +419,6 @@ export default class GameScene extends Scene {
...
@@ -417,7 +419,6 @@ export default class GameScene extends Scene {
boomScoreSp
:
FYGE
.
Sprite
boomScoreSp
:
FYGE
.
Sprite
onBoomFunc
({
data
})
{
onBoomFunc
({
data
})
{
this
.
score
-=
10
this
.
score
-=
10
this
.
boomScore
-=
10
// 重新计算连击
// 重新计算连击
this
.
shortCutNum
.
reDo
()
this
.
shortCutNum
.
reDo
()
this
.
allGameEles
.
forEach
((
ele
,
i
)
=>
{
this
.
allGameEles
.
forEach
((
ele
,
i
)
=>
{
...
@@ -563,7 +564,7 @@ export default class GameScene extends Scene {
...
@@ -563,7 +564,7 @@ export default class GameScene extends Scene {
}
}
drawBlade
=
throttle
((
e
)
=>
{
drawBlade
=
throttle
((
e
)
=>
{
!
this
.
isOver
&&
this
.
blade
&&
this
.
blade
.
drawBlade
(
e
)
(
!
this
.
isOver
||
this
.
isCrazy
)
&&
this
.
blade
&&
this
.
blade
.
drawBlade
(
e
)
},
0
)
},
0
)
// 帧事件
// 帧事件
...
@@ -571,7 +572,7 @@ export default class GameScene extends Scene {
...
@@ -571,7 +572,7 @@ export default class GameScene extends Scene {
let
len
=
this
.
gameEles
.
length
let
len
=
this
.
gameEles
.
length
for
(
var
i
=
len
-
1
;
i
>=
0
;
i
--
)
{
for
(
var
i
=
len
-
1
;
i
>=
0
;
i
--
)
{
var
curr
=
this
.
gameEles
[
i
]
var
curr
=
this
.
gameEles
[
i
]
if
(
curr
.
y
>
layers
.
stageHeight
)
{
if
(
curr
.
y
>
layers
.
stageHeight
+
100
)
{
curr
.
comeDown
()
curr
.
comeDown
()
if
(
curr
instanceof
MoonCake
)
{
if
(
curr
instanceof
MoonCake
)
{
// @ts-ignore
// @ts-ignore
...
@@ -593,7 +594,7 @@ export default class GameScene extends Scene {
...
@@ -593,7 +594,7 @@ export default class GameScene extends Scene {
let
llen
=
this
.
leftCrazyMoonCake
.
length
let
llen
=
this
.
leftCrazyMoonCake
.
length
for
(
let
i
=
llen
-
1
;
i
>=
0
;
i
--
)
{
for
(
let
i
=
llen
-
1
;
i
>=
0
;
i
--
)
{
let
curr
=
this
.
leftCrazyMoonCake
[
i
]
let
curr
=
this
.
leftCrazyMoonCake
[
i
]
if
(
curr
.
y
>
layers
.
stageHeight
)
{
if
(
curr
.
y
>
layers
.
stageHeight
+
100
)
{
curr
.
comeDown
()
curr
.
comeDown
()
if
(
curr
instanceof
MoonCake
)
{
if
(
curr
instanceof
MoonCake
)
{
// @ts-ignore
// @ts-ignore
...
@@ -608,7 +609,7 @@ export default class GameScene extends Scene {
...
@@ -608,7 +609,7 @@ export default class GameScene extends Scene {
let
rlen
=
this
.
rightCrazyMoonCake
.
length
let
rlen
=
this
.
rightCrazyMoonCake
.
length
for
(
let
i
=
rlen
-
1
;
i
>=
0
;
i
--
)
{
for
(
let
i
=
rlen
-
1
;
i
>=
0
;
i
--
)
{
let
curr
=
this
.
rightCrazyMoonCake
[
i
]
let
curr
=
this
.
rightCrazyMoonCake
[
i
]
if
(
curr
.
y
>
layers
.
stageHeight
)
{
if
(
curr
.
y
>
layers
.
stageHeight
+
100
)
{
curr
.
comeDown
()
curr
.
comeDown
()
if
(
curr
instanceof
MoonCake
)
{
if
(
curr
instanceof
MoonCake
)
{
// @ts-ignore
// @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