Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoxiaole
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
xiaoxiaole
Commits
b18f63e5
Commit
b18f63e5
authored
Dec 21, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6f84012c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
4 deletions
+31
-4
MainScene.ts
egret/src/mainScene/MainScene.ts
+31
-4
No files found.
egret/src/mainScene/MainScene.ts
View file @
b18f63e5
...
@@ -254,7 +254,7 @@ export default class MainScene extends Scene {
...
@@ -254,7 +254,7 @@ export default class MainScene extends Scene {
//记录是否有红包炸弹弹框
//记录是否有红包炸弹弹框
redBombPanelMark
:
boolean
;
redBombPanelMark
:
boolean
;
start
(
data
)
{
async
start
(
data
)
{
super
.
start
();
super
.
start
();
//第几关
//第几关
this
.
chapter
=
(
data
&&
data
.
chapter
)
?
data
.
chapter
:
1
;
this
.
chapter
=
(
data
&&
data
.
chapter
)
?
data
.
chapter
:
1
;
...
@@ -284,8 +284,11 @@ export default class MainScene extends Scene {
...
@@ -284,8 +284,11 @@ export default class MainScene extends Scene {
//设置栏置顶
//设置栏置顶
this
.
addChild
(
this
[
"settingAll"
])
this
.
addChild
(
this
[
"settingAll"
])
this
.
addChild
(
this
[
'redrainbg'
]);
this
.
addChild
(
this
[
'redrainbg'
]);
this
[
'redrainbg'
].
visible
=
false
;
this
.
addLoading
();
//先判断是否添加节日元素,如果加节日元素,就按initFestivalEle里的来
//先判断是否添加节日元素,如果加节日元素,就按initFestivalEle里的来
if
(
!
this
.
initFestivalEle
())
{
const
initFestivalEleResult
=
await
this
.
initFestivalEle
();
if
(
!
initFestivalEleResult
)
{
//检查一次三消
//检查一次三消
if
(
this
.
threeMatch
())
{
if
(
this
.
threeMatch
())
{
this
.
eliminate
();
this
.
eliminate
();
...
@@ -306,7 +309,7 @@ export default class MainScene extends Scene {
...
@@ -306,7 +309,7 @@ export default class MainScene extends Scene {
this
.
initSvgas
();
this
.
initSvgas
();
//AiControl初始化,
//AiControl初始化,
AiControl
.
ins
.
init
(
this
.
lattices
);
AiControl
.
ins
.
init
(
this
.
lattices
);
this
.
addLoading
();
}
}
async
addLoading
(){
async
addLoading
(){
...
@@ -318,6 +321,26 @@ export default class MainScene extends Scene {
...
@@ -318,6 +321,26 @@ export default class MainScene extends Scene {
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/loading_progress.svga'
,
this
[
'container3'
]);
await
loadSvga
(
getResPath
()
+
'resource/assets/svgas/loading_progress.svga'
,
this
[
'container3'
]);
}
}
startPlayLoadingAni
(){
const
setProgress
=
(
per
:
number
)
=>
{
egret
.
Tween
.
get
(
this
[
'progressmask2'
]).
to
({
scaleX
:
per
/
100
},
100
);
this
[
'percentTxt'
].
text
=
`
${
per
}
%`
}
return
new
Promise
((
r
)
=>
{
let
timer
,
current
=
0
;
timer
=
setInterval
(()
=>
{
current
++
;
setProgress
(
current
);
if
(
current
>=
100
)
{
clearInterval
(
timer
);
wait
(
500
).
then
(
r
);
}
},
1000
/
30
);
});
}
/**
/**
* 加载所有用到的svga
* 加载所有用到的svga
*/
*/
...
@@ -734,7 +757,7 @@ export default class MainScene extends Scene {
...
@@ -734,7 +757,7 @@ export default class MainScene extends Scene {
}
}
//初始化节日元素
//初始化节日元素
initFestivalEle
():
boolean
{
async
initFestivalEle
()
{
//添加节日元素,条件可能会变
//添加节日元素,条件可能会变
if
(
if
(
fesChapterData
.
indexOf
(
this
.
chapter
>>
0
)
>
-
1
&&
fesChapterData
.
indexOf
(
this
.
chapter
>>
0
)
>
-
1
&&
...
@@ -743,6 +766,10 @@ export default class MainScene extends Scene {
...
@@ -743,6 +766,10 @@ export default class MainScene extends Scene {
this
.
lattices
[
festivalIndex
]
&&
//格子必须有
this
.
lattices
[
festivalIndex
]
&&
//格子必须有
(
Tool
.
judgeSetFesEle
(
this
.
lattices
[
festivalIndex
])
||
!
this
.
lattices
[
festivalIndex
].
element
)
//没有元素也行
(
Tool
.
judgeSetFesEle
(
this
.
lattices
[
festivalIndex
])
||
!
this
.
lattices
[
festivalIndex
].
element
)
//没有元素也行
)
{
)
{
this
[
'redrainbg'
].
visible
=
true
;
await
this
.
startPlayLoadingAni
();
this
[
'redrainbg'
].
visible
=
false
;
var
p
=
Tool
.
getPositionByIndex
(
festivalIndex
);
var
p
=
Tool
.
getPositionByIndex
(
festivalIndex
);
//添加节日红包目标
//添加节日红包目标
this
.
festivalTarget
=
new
FestivalTarget
(
this
.
festivalTargetNum
);
this
.
festivalTarget
=
new
FestivalTarget
(
this
.
festivalTargetNum
);
...
...
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